On 12/12/06, Nathan R. Yergler <[EMAIL PROTECTED]> wrote:
> Note that the property built-in takes the "getter" as the first,
> required argument and the "setter" as the optional, second argument.  So
> if you were going to do this with properties you'd want to do:
>
> class Entry(models.Model):
>     post_date = models.DateTimeField(...)
>     posted = models.BooleanField(...)
>
>     def get_posted(self):
>         return self.posted
>
>     def set_posted(self, new_value):
>         if new_value != self.posted:
>             self.post_date = datetime.datetime.now()
>
>     posted = property(get_posted, set_posted)

Ah, right, good catch! Thanks for pointing out my mistake.

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

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