On 16 déc, 07:53, JF Simon <[email protected]> wrote:
> 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'
>
> }

If I may ask and just out of curiousity: I assume this 'context' is
intended to be passed to a template. if so, why not just  pass the
Page object itself ?


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