On Tue, Jun 10, 2008 at 9:25 PM, Wim Feijen <[EMAIL PROTECTED]> wrote:
>
> Coding happily away...
>
> And wondering, can I write better code, using a loop, perhaps? In
> other words: can I set settings.groupon while using a variable in
> stead of groupon?
>
> Thanks for any recommendations you are willing to make!

Looks like you might want to have a look at the contents of
Settings._meta, also called the Options object. This object contains a
lot of meta-data about the class, such as the various names that can
be used to refer to the class, the fields on the class, and so on. The
meta object is available on the class and on instances.

In particular, you're probably looking to iterate over
settings._meta.fields; each member of this list will be a Field
object, from which you can get field.name, field.attname, and many
other useful details.

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
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