Malcolm,  Must be pilot error  and I can't replicate the error any
longer - I do apologize for wasting your time.

However, one additional question.. is there an easy way to a record
from a queery set dynamically (without touching the DB)?  What I'm
looking do do in my view is as follows:-

1.  Create query set using a filter.
2.  Add attributes to query set, via setattr (but not commit these to
the DB)
3.  Dyanmically filter the query set based on these new attributes
4.  Return the qs to the template.

Step 3 is still a slight puzzle.  As a work around I am doing the
following (but I suspect there must be a better way!)

ls=[]
for i in qs:
    if i.newattribute == somevalue:
          ls.append(i)

I am then return the list rather than the qs to the template.

cheers

MerMer




> Something more than what you think is going on here. This sort of simple
> example (iterating through a queryset adding an attribute, then
> iterating again to read the attribute) works perfectly for me. I just
> tested it on half a dozen different models without problems.
>
> So you might need to do some looking around to work out what is special
> about your models. Or look at the details you might have trimmed to make
> the example simpler and start putting them back in one by one.
>
> Regards,
> Malcolm


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to