Excellent, that works perfectly. Thanks for you help.
Wes On May 22, 9:58 am, bruno desthuilliers <bruno.desthuilli...@gmail.com> wrote: > On May 22, 10:34 am, wchildsuk <childs.wes...@gmail.com> wrote: > > > Hi, > > > I'm trying to use generic class based views to edit a specific > > queryset but I can't see to get my code working. I've defined queryset > > Nope, cf Xavier's answer on this. > > > and relevant form but when the form renders it doesn't contain the > > queryset and when it saves it creates a new entry instead of editing > > the existing one. > > from the FineManual: > > """class CreateView > > A view that displays a form for creating an object, redisplaying > the form with validation errors (if there are any) and saving the > object. > """ > > ""class UpdateView > > A view that displays a form for editing an existing object, > redisplaying the form with validation errors (if there are any) and > saving changes to the object. > """ > > Your code: > > """ > class ManageReminderMessages(CreateView): > ... > """ > > As a last note: the pk of the model instance to be edited is usually > passed as part of the url (cf the relevant chapter in the > FineManual)... Unless you want to write a new view for each and any > instance of your model, of course ;) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.