Hi,
I'm used to doing things like this;
resources = Resource.objects.all()
for resource in resources:
if resource.thetype == 'url':
resource.link = '/access/redirect?location=%s' % resource.uuid
else:
resource.link = '/access/download/%s/%s' % (resource.uuid,
resource.filename)
It means that more logic is shunted from the template to the view.
This helps some browsers to determine what they should do with a link
(we use file-disposition and mimetype etc - but we still need to do
this)
I've just wired this up to generic views and find that this line (46)
in django/views/generic/list_detail.py causes the 'link' attribute to
disappear. (I put 'queryset[0].__dict__' before and after the line and
'link' had dissappeared)
46: queryset = queryset._clone()
Is this expected behaviour? If so, should I be doing things in a
different way (property on the model perhaps)?
Any thoughts appreciated
Cheers,
Tone
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---