Idea: "fake" model fields

2005-09-16 Thread Simon Willison
I'm trying to work out the best way to implement tagging in Django, for a relaunch of my blog system. The model seems natural enough: class Tag(meta.Model): tag = meta.SlugField() ... class Entry(meta.Model): pub_date = meta.DateTimeField() headline = meta.CharField(maxlengt

Re: Idea: "fake" model fields

2005-09-16 Thread Jeremy Dunck
On 9/16/05, Simon Willison <[EMAIL PROTECTED]> wrote: > tagfield = meta.FakeCharField() > def load_tagfield(self): > # Returns the contents of the field when it is displayed > def save_tagfield(self, value): ... Instead of Fake*, I suggest Deferred, or Mapped*, or Extended*.

Re: Idea: "fake" model fields

2005-09-16 Thread Sune Kirkeby
On 9/16/05, Simon Willison <[EMAIL PROTECTED]> wrote: > Another extremely common problem is the need to have a field > automatically set to some value when an item is created or updated > (most commonly a field such as pub_date or last_modified). I wonder > if the above mechanism, or something sim

Re: Idea: "fake" model fields

2005-09-16 Thread Adrian Holovaty
On 9/16/05, Sune Kirkeby <[EMAIL PROTECTED]> wrote: > On 9/16/05, Simon Willison <[EMAIL PROTECTED]> wrote: > > Another extremely common problem is the need to have a field > > automatically set to some value when an item is created or updated > > (most commonly a field such as pub_date or last_mo