Re: extracting field information from models

2006-12-17 Thread Milan Andric
On Dec 16, 1:01 pm, "Phil Davis" <[EMAIL PROTECTED]> wrote: >Try: > > app_fields = [] > for f in app._meta.fields: >app_fields.append( > { > 'label' : f.verbose_name, >'value': getattr(app, f.name), > } > > Works for me on Boolean fields. > Thanks, getattr() did th

Re: extracting field information from models

2006-12-16 Thread Phil Davis
On 12/15/06, Milan Andric <[EMAIL PROTECTED]> wrote: > I would like to loop through the fields in my model and print the names > (verbose_name) and value of the fields. I've been hacking at it for > sometime but can't figure it out. I had some help from Magus on IRC > but still can't find soluti

extracting field information from models

2006-12-14 Thread Milan Andric
Hello, I would like to loop through the fields in my model and print the names (verbose_name) and value of the fields. I've been hacking at it for sometime but can't figure it out. I had some help from Magus on IRC but still can't find solution. See: http://simon.bofh.ms/logger/django/2006/12/1