Ticket #9150 needs design decision: Generic views should accept arguements for form_class

2009-08-23 Thread tom
Hi, The form_class property for generic views such a django.views.generic.create_update.* should accept either a ModelForm? class or a ModelForm? object. This would allow generic "wrapper views" to easily inject run-time data into the form instance. Here is an example: def project_new(request):

Re: On returning appropriate subclass instances when querying a model with subclasses

2009-08-23 Thread Andrea Zilio
So the answer to the question "Can I get the right instances with one single and only DB query" seems to be: "No, you cannot do so without touching the Django orm code". Am I right? On Aug 24, 1:52 am, Russell Keith-Magee wrote: > > > Or if this is planned for some future release. > > As I said

Re: On returning appropriate subclass instances when querying a model with subclasses

2009-08-23 Thread Russell Keith-Magee
On Sun, Aug 23, 2009 at 11:00 PM, Andrea Zilio wrote: > > Great, but that wasn't exactly what I was looking for. > > What I need is a way to get the right instances from a *single* query. > > This means that I should do LEFT JOINS on direct subclasses of the > base class. > > What I need to know i

Re: Revisit ticket 2713?

2009-08-23 Thread Chris Beaven
Yeah, named urls didn't direct fix the problem. I've submitted a new patch. Now someone just needs to write the tests :P --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this grou

#11775 ABSOLUTE_URL_OVERRIDES doesn't work for the majority of contrib models

2009-08-23 Thread Jukka
Hi all, I've been working with Django for a bit now, and decided to try contributing, by submitting a patch to fix a problem I ran into at work. This seems like something that requires a design decision. So, what do you think? --Jukka --~--~-~--~~~---~--~~ You r

Re: Final Multi-DB status Update

2009-08-23 Thread JL
So over the weekend I've been thinking about the problem of the two potential use cases for following relationship fields in Django models: 1) All (or most) models exist on every db instance and the data is sharded somehow or 2) Different models exist on different db instances but all data for a p

Re: On returning appropriate subclass instances when querying a model with subclasses

2009-08-23 Thread Andrea Zilio
Great, but that wasn't exactly what I was looking for. What I need is a way to get the right instances from a *single* query. This means that I should do LEFT JOINS on direct subclasses of the base class. What I need to know is if this is somehow possible without editing the Django core, but us

Re: On returning appropriate subclass instances when querying a model with subclasses

2009-08-23 Thread Marc Fargas
On Sun, Aug 23, 2009 at 1:54 PM, Andrea Zilio wrote: > > So seems that this idea was in fact rejected because of the O(# of > nodes in the inheritance tree) joins > needed to get all the fields from subclass tables. > You may want to loook at Alex's post on the subject: http://lazypython.blogspo

Re: On returning appropriate subclass instances when querying a model with subclasses

2009-08-23 Thread Andrea Zilio
Thanks! I think I've found the discussion you're talking about: http://groups.google.com/group/django-developers/browse_thread/thread/7d40ad373ebfa912/a20fabc661b7035d So seems that this idea was in fact rejected because of the O(# of nodes in the inheritance tree) joins needed to get all the fie

Re: On returning appropriate subclass instances when querying a model with subclasses

2009-08-23 Thread Russell Keith-Magee
On Sun, Aug 23, 2009 at 9:18 AM, Andrea Zilio wrote: > > Hi all, > > Here's what I'm talking about: > You have 3 models: Place, Restaurant and Cinema where Restaurant and > Cinema both inherits from Place. > So in the database you have some simple places, some places which > really are Cinemas and