On Apr 11, 11:10 pm, codecowboy <guy.ja...@gmail.com> wrote:
> Thank you Daniel.  I got it working.  That link that you gave me
> helped me to figure it out.  I'm curious though, is there ever a
> reason in Django to define a method in a model class or would I always
> use a custom manager method?

It's frequently useful to define normal (instance) methods within
models, which operate on a single instance - eg to provide a formatted
or calculated version of one or more of the model fields for use in a
template, or to override the save method with some custom validation,
etc.

Whether or not you use class methods within a model is up to you - I
have used them as a useful place to define signals on a particular
model class, but you certainly don't need them for that.
--
DR.
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to