Hello, i'm new with python (and french so my english may seem very
poor, sorry about that).
I would like to list a model's fields and return a dict, here is the
example :
I have a model class with :
meta_title : CharField(...)
meta_description : CharField(...)
body_header_title : CharField(...)
body_header_text : CharField(...)
foot : CharField(...)
This class represents context for a page. This class will have a
function get_context() who will return :
{
meta :
{
title : 'value of meta_title' ,
text : 'value of meta_text' ,
} ,
body :
{
header :
{
title : 'value of body_header_title ,
text : 'value of body_header_text ,
}
} ,
foot : 'value of foot'
}
So i would like to :
1. get the list of my class's fields attributes
2. parse their names to obtain the dict
Thanks a lot to the ones who read this message to the bottom !!
Long live the Django project !!!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---