To take peoples minds of of Dutch football teams and bathroom cleaning
fluids....

I'm poodling around in a private svk branch so I don't break new-admin
;-) Specifically, I'm doing core fields removal, extending iholsmans
#747 ( getting all field determined model instance methods and module
methods into the fields themselves), the subtyping thing, and mutually
recursive models ( ie allowing the name of a class instead of the class
itself as the to argument to a ForeignKey or ManyToManyField).

Anyway, I'm considering the model syntax we've got and if maybe there
are a few extensions possible that could make it nicer.

For validation, we could do something like :

from django.core import meta, validate

class Poll:
  date = meta.DateTimeField()
  question = meta.CharField(maxlength=100)
  category = meta.ForeignKey(category)

  validate.fields(date,question).unique() # -> unique together
  validate.field(category).unique_for_month(date)

Basically, this would just temporarily stuff something onto one of the
field objects, which would then be put into the correct place by the
metaclass. Validators would need to register themselves to be usable in
this way.

Thoughts?

Reply via email to