Custom manipulator, default form?

0 views
Skip to first unread message

Rob Slotboom

unread,
Jan 16, 2007, 2:58:15 AM1/16/07
to Django users
For one of my models I need to do some extra validation.
Because of what I want it isn't possible to just rely on a validator, I
need a manipulator to get a request object.

The manipulator only has to add an extra validator to one field. This
validator validates using the database. No custom form is needed. The
manipulator will be used within Django's admin.

I searched and red and searched and red again but I couldn't find an
answer on this one:
How to add a custom manipulator, extending the default one, to a model
using the default form?

--
Robert Slotboom

Aidas Bendoraitis

unread,
Jan 16, 2007, 3:59:43 AM1/16/07
to django...@googlegroups.com
I would try just to extend the custom manipulator as you would do with
custom manager:

class CustomAddManipulator(models.manipulators.AutomaticAddManipulator):
# ... override the manipulator ...

class CustomChangeManipulator(models.manipulators.AutomaticChangeManipulator):
# ... override the manipulator ...

class MyModel(models.Model):
AddManipulator = CustomAddManipulator
ChangeManipulator = CustomChangeManipulator


Good luck!
Aidas Bendoraitis aka Archatas

Reply all
Reply to author
Forward
0 new messages