On Mar 23, 2009, at 6:48 PM, Liubomir.Petrov wrote:

>
> Yep, i'm already using generic views, but its a big pain (a lot of
> code) for a single view that embeds create & update in one place.
> I wanned to ask here, because maybe my approach (the single create/
> update view) is not right ?

I'm not quite sure what you mean here, are you saying it's a lot of  
code in your url config to have CRUD lines for each model in each app?  
You could take a look at the admin app to see how it does model  
autodiscovery, and get some ideas about how you might automatically  
create url config lines for each model. The code lives in contrib/ 
admin/sites.py

Is that what you meant?


>
> On Mar 23, 12:13 pm, Eric Abrahamsen <gir...@gmail.com> wrote:
>> On Mar 23, 2009, at 6:06 PM, Lyubomir Petrov wrote:
>>
>>
>>
>>> Just wondering are there any docs/examples of design pattern with
>>> django for creating a "create/update" view.
>>
>> These views are written for you! See the CRUD section of the Generic
>> Views page:
>>
>> http://docs.djangoproject.com/en/dev/ref/generic-views/#create- 
>> update...
>>
>> All you have to do is design the URLs, and you can take hints from  
>> the
>> admin contrib app for that.
>>
>> Yours,
>> Eric
>>
>>
> >


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to