Thank you AmanKow.  I will try adding a method to my model to "hold"
the additional "field."

On Sep 7, 9:57 am, AmanKow <[EMAIL PROTECTED]> wrote:
> Monkey patching attributes to the instances would not be the correct
> django idiom for adding a calculated field.  There is a simple and
> straight forward django idiom for expressing calculated fields in the
> model.
>
> In your car model, create a method named 'comment' returning the
> required information:
>
> def comment(self):
>     # ... do your calculations here
>     return # your calculated result here
>
> Now just go to town accessing it just like a field when you need it.
>
> You can even decorate it with additional information, such as
> help_text or short_description to make it even more 'fieldy'.
>

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