Re: List a model fields

2008-12-16 Thread bruno desthuilliers
On 16 déc, 10:26, JF Simon wrote: > thanks dude. > > any idea to split the dict on the _ char ? > recursive function ? Probably not the most elegant solution, but it should do the trick: def add_to_context(self, context, field): current = context parts = field.name.split('

Re: List a model fields

2008-12-16 Thread bruno desthuilliers
On 16 déc, 07:53, JF Simon 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 :

Re: List a model fields

2008-12-16 Thread JF Simon
thanks dude. any idea to split the dict on the _ char ? recursive function ? --~--~-~--~~~---~--~~ 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

Re: List a model fields

2008-12-15 Thread Daniel Roseman
On Dec 16, 6:53 am, JF Simon 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

List a model fields

2008-12-15 Thread JF Simon
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(...)