I am attempting to create a printable version of several models from
the admin, seeing that Django 1.2 has included readonly_fields I
decided to try and experiment by setting them dynamically
trick is when I include the following logic it comes back passing the
if statement regardless of what/if GET vars are passed
def get_readonly_fields(self, request, obj=None):
if request.GET.get('print', False):
self.readonly_fields = []
for field_group in self.fieldsets:
for field in field_group[1]['fields']:
self.readonly_fields.append(field)
#pass
#self.form_template = 'print.html'
return self.readonly_fields
any ideas why this would process as True? as I'm stumped for the moment
--
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.