On 11/23/05, Kevin <[EMAIL PROTECTED]> wrote:
>
> Ok, I jumped into Django's code and it seems that the where_constraints
> is instead an array of sql strings, not the keyword mapping.
>
> so instead of:
> where_constraints = {'online__exact: True}
> you would need:
> where_constraints = ['online = true']
>
> Unfortunately, this basically makes it impossible to retrieve any row
> in the database that doesn't match the clause.  So in my example, if
> you set the online field to false, you can never retrieve that article
> without resorting to altering the database outside of django.

Actually, you can.

>>> from django.models.article import articles
>>> original_constraints = articles.Klass._meta.where_constraints
>>> articles.Klass._meta.where_constraints = []
>>> articles.get_list(online__exact=False)
>>> articles.Klass._meta.where_constraints = original_constraints

But is this safe or will it eventually cause problems?

Andreas

Reply via email to