I’m a bit new to tastypie: I’ve been creating objects in custom views that I pass through override_urls.
Is it alright to not use obj_create and just do things in the custom views, or will this cause some trouble further down the line?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You normally should use obj_create because it handles all the authorisation and authentication for you. If you use some other views (I imagine that creating new model instances should be done in some helper methods not actually views) that shouldn’t be any trouble if you would follow the simple steps:
override_urlsuse thewrap_viewmethod from tastypieA more simple approach would be to only override the
obj_createinside your resources and inside this method call other views/methods, use the parent method or decide not to use it at all.