2010-3-8

18:55 subsume
You just join the CT table.
18:55 subsume
creates two joins instead of 1.
18:55 Alex_Gaynor
That'd select the content type (which you can of course already do), not the final object
18:56 subsume
if you stopped there, of course not. you go one further and join the final object.
18:56 Alex_Gaynor
Except you can't join an unkown table in SQL
18:57 subsume
you know the table by the CT.
18:57 Alex_Gaynor
Yes, but you can't do SELECT * FROM my_table JOIN content_type ON content_type.id = my_type.content_type JOIN content_type.db_table ON somethign;
18:59 subsume
well no. But you wouldn't. Maybe a select_related would trigger some extra() work.
18:59 subsume
to keep out of internals.
19:00 Alex_Gaynor
I don't follow, the query you're suggesting isn't possible at the SQL level
19:00 subsume
I'll have to prepare a snippet.
19:04 cramm
Hi guys. A spriner from last Saturday has posted a patch for #12627 and we would like to ask for review aout the sstrategy used to fix the issue.
19:04 DjangoBot
19:06 Alex_Gaynor
cramm: why not just have admin validation disallow ModelAdmin with no fields?
19:06 subsume
Eh, there's nothing tidy enough that would ever be accepted into the ORM
19:10 cramm
Alex_Gaynor: Problems is that the ticket report two issues together. The readonly_fields one is admin-specific, and the all-model-field-with-editable=False isn't
19:11 Alex_Gaynor
cramm: perhaps that should be form level validation then? at the end of forms.Form.__init__ have assert self.fields, "There must be fields on a form"
19:14 subsume
yeah, I suppose it could only be done with two queries and I'm not sure how the second part would happen. It would essentially be an ugly find-and-replace of the first statement.
19:16 cramm
Alex_Gaynor: Thanks for your fedback. The PyCamp is ending now, they plan keep working on it
19:22 Alex_Gaynor
19:35 Alex_Gaynor
jezdez: ^ :)
19:54 mat
Could anyone here review the unit test I made in http://code.djangoproject.com/ticket/12822 ? I'm not 100% sure what's going on but looks like I found another regression in 1.2 when playing with aggregation
22:50 drygal
help needed with something simple - how to list subselect model linked by foreign key for each object parent please?
22:50 apollo13
drygal: #django
22:51 drygal
sorry, leaving, no answer there thoguh ...
Page 2 of 2   ← Previous  (125 total)