Re: Circular dependency in forms+views+models

2013-09-02 Thread Marc Tamlyn
Opened a ticket - https://code.djangoproject.com/ticket/21022 On 2 September 2013 14:37, Russell Keith-Magee wrote: > > I agree with Marc -- the fix here is that you should be using a named URL, > not referencing the view directly. The circular dependency shouldn't

Re: Circular dependency in forms+views+models

2013-09-02 Thread Russell Keith-Magee
I agree with Marc -- the fix here is that you should be using a named URL, not referencing the view directly. The circular dependency shouldn't exist - it should be broken by the dereferencing provided by the URL name. This is a feature that was added late in the development of Django (well…

Re: Circular dependency in forms+views+models

2013-09-02 Thread Marc Tamlyn
I think the main issue here is using the view (name OR instance) as the reference. We really should be pushing naming of urls more in the documentation - they're always mentioned but as a "you might prefer to do this" rather than a "use URL names on every URLpattern and in reverse. You could also

Re: Circular dependency in forms+views+models

2013-09-01 Thread Curtis Maloney
Given both the docs for get_absolute_url and reverse demonstrate using string references only, I think adding in clarification of why it's preferred is worthwhile. I still find it surprising how often I need to tell people on #django to not import models just to reference them in relation