Re: Efficiency of getting attribute values in templates

2009-07-07 Thread Nikola Pavlović
On Fri, Jul 03, 2009 at 09:04:37AM -0700, Rajesh D wrote: > > On Jul 3, 9:17 am, Nikola Pavlović wrote: > > Hello people, > > > > I'm writing my first Django application and would like to know what is > > considered more efficient: getting values of models' attributes in views > > or directly in

Re: Efficiency of getting attribute values in templates

2009-07-05 Thread Rajesh D
On Jul 4, 9:28 pm, TechnicalBard wrote: > But the admin app does - it defines the labels from the attribute > names and just puts them all in a table or list. > > How does one do that? Actually, you tell it which fields you want to display through the list_display attribute on your Admin class

Re: Efficiency of getting attribute values in templates

2009-07-04 Thread TechnicalBard
But the admin app does - it defines the labels from the attribute names and just puts them all in a table or list. How does one do that? Analogous to iterating through a list of objects, is it possible to iterate through the attributes of a single object? On Jul 4, 5:32 pm, Rajesh D wrote: > O

Re: Efficiency of getting attribute values in templates

2009-07-04 Thread Rajesh D
On Jul 4, 6:30 pm, TechnicalBard wrote: > Is there a way to pass an object to the template and have the template > handle all of the attributes without hardcoding them into the > template? Depends on what you mean by "handle". The template won't by itself know the markup with which you want to

Re: Efficiency of getting attribute values in templates

2009-07-04 Thread TechnicalBard
Is there a way to pass an object to the template and have the template handle all of the attributes without hardcoding them into the template? On Jul 3, 10:04 am, Rajesh D wrote: > On Jul 3, 9:17 am, Nikola Pavlović wrote: > > > > > > > Hello people, > > > I'm writing my first Django applicatio

Re: Efficiency of getting attribute values in templates

2009-07-03 Thread Rajesh D
On Jul 3, 9:17 am, Nikola Pavlović wrote: > Hello people, > > I'm writing my first Django application and would like to know what is > considered more efficient: getting values of models' attributes in views > or directly in templates? > > More precicely, say we have a Person model with name an

Efficiency of getting attribute values in templates

2009-07-03 Thread Nikola Pavlović
Hello people, I'm writing my first Django application and would like to know what is considered more efficient: getting values of models' attributes in views or directly in templates? More precicely, say we have a Person model with name and id attributes, and these need to be shown on a page.