Nevermind, I think I found my answer.

in the model._meta attribute, there is an attribute called fields
(model._meta.fields) that is a list of the fields in the model, in the
order in which you defined them.

On Dec 15, 10:24 am, bfrederi <[email protected]> wrote:
> If I've defined a model like so:
>
> class comment(models.Model):
>     name = models.CharField(max_length=25)
>     place = models.CharField(max_length=100, blank=True)
>     comment = models.TextField()
>
> How do I get the order I defined the model fields in, once I have the
> model object.
>
> For instance:
>
> model = models.get_model(app_label, model_name)
>
> I now have the model object, and I want to be able to get the correct
> order of the fields as I have defined them (name, place, and comment,
> in that order). Is there a method in django to get that ordering?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to