Django CRUD questions

70 views
Skip to first unread message

drewyan

unread,
Apr 25, 2012, 11:18:45 AM4/25/12
to django...@googlegroups.com
Hi all,

I'm relatively new at designing web apps and I've been using Django to set-up a CRUD type application. I recently figured out how perform POST requests from the forms I set-up. I noticed that the data can be changed/updated through the Django admin site or through the Django API using SQL; I'm sure there's a way for non-admins who don't know SQL to retrieve and change/update the data they input through the web app, but it's not clear to me how to accomplish that (or even where to start looking). It looks like "

django.views.generic.create_update.create_object" might do the trick, but I'm not using generic views. Are there other options for retrieving form data and then updating it? If you'd like further information, I'd be happy to provide it.


Many thanks.

drewyan

unread,
Apr 25, 2012, 11:31:25 AM4/25/12
to django...@googlegroups.com
Any useful resources or examples you can suggest would very much appreciated as well.

Kurtis Mullins

unread,
Apr 25, 2012, 11:36:05 AM4/25/12
to django...@googlegroups.com
Check out ModelForms: https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#django.forms.ModelForm
Note: I'm not sure which version of Django you are using but you may want to choose a different document-version respectively.

Also, check out CreateView, UpdateView, and DeleteView for your Views:  https://docs.djangoproject.com/en/dev/ref/class-based-views/ 
An example that I came across from a quick search:  http://stackoverflow.com/questions/5773724/how-do-i-use-createview-with-a-modelform 

Good luck!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/sKakMf6m_k4J.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Reply all
Reply to author
Forward
0 new messages