Mikhail,

Thanks. I like that idea.  Simple and understandable for those who
follow me.

On Jan 16, 2:51 pm, Mikhail Korobov <kmik...@googlemail.com> wrote:
> It doesn't work that way. ORM translates you queries to SQL and the DB
> is responsible for filtering. It is not possible to translate
> arbitrary python function to SQL or pass it to DB engine. So you have
> to formulate you query using .filter syntax or raw SQL.
>
> Another possibility is to denormalize data: add 'complete' field to
> the model and recalculate it on save (or whenever it make sense). This
> is often a good solution and it is better than complex queries in
> terms of performance.
>
> On 16 янв, 19:16, rmschne <rmsc...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Thanks. I'm still messing with this; but don't think it quite what I'm
> > looking for.
>
> > I want/need the Model Definition function complete() for use at the
> > record level.  I did this as a function since the rules are not based
> > simply on the value of the fields.
>
> > Ideally, I'd like to have the class DinnerHoseManager(modes.Manager)
> > use the complete() function to help return the query set for where
> > complete()=True.  How to put that into this class?
>
> > It's not the simple filter. Need a little more complexity to
> > determining "complete" based on the two if statements.

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