First off, you need to correct permitted_methods to read
permitted_methods = ('POST',)
So its a single element list.(notice the trailing comma)
If what you want to do is store persons into the database and person is
a model, then no you don't need a non-model resource.
The concept is very simple...just POST data to the url that maps to this
resource and django-rest-interface will deserialize it and store it into
the database. To look at the structure of the needed xml, add GET as a
permitted method and visit the url and look at the generated xml and
just replicate that.
--
Regards,
Alaa Salman
Entrepreneur, Contractor, Programmer
http://www.codedemigod.com
Free Software Foundation Associate Member #6304
"One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man." ---Elbert Hubbard
"Never measure the height of a mountain until you have reached the top. Then you will see how low it was." ---Dag Hammarskjold
Ah i see. Well, i think you can try and subclass Receiver and implement
a specialized XMLReceiver. But take not that the default XMLReceiver
uses the django serializer, so it expects the xml in a certain way. This
is where you'll have to use an xml parser and pass back a dictionary.
Take a look at the code in receiver.py for inspiration.
Well, this really has nothing to do with django-rest-interface. It has
to do with django itself. The django serializer and deserializer is
what's doing the work here. The good news is that you can get a model
instance from the deserializer....
This conflicts with your previous emails, since you asked about
receiving xml rather than providing it. But regardless, try changing the
queryset provided to the collection. Since all the app does here is
serialize the given queryset.