Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Uniqueness validation in custom manipulator [RSS Feed]

#1 Nov. 13, 2005 23:39:57

M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Uniqueness validation in custom manipulator


Hi!Automatic manipulators (ChangeManipulator, AddManipulator) have allthese nice things like uniqueness validation for fields that wasdeclared unique in a model. I'd like to use all this goodness in acustom manipulator. Is it possible?

Offline

#2 Nov. 14, 2005 00:20:07

Adrian H.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Uniqueness validation in custom manipulator


On 11/13/05, Maniac <> wrote:
> Automatic manipulators (ChangeManipulator, AddManipulator) have all
> these nice things like uniqueness validation for fields that was
> declared unique in a model. I'd like to use all this goodness in a
> custom manipulator. Is it possible?

Hey Maniac,

Yup, of course it's possible! :)

Just set validator_list, as appropriate, for any of the fields in your
manipulator. See the full list of validators in
django/core/validators.py.

The automatic manipulators set validator_list automatically, to some
automatic validation functions, but if you want to do things like
checking for uniqueness, you'll have to write the validator function
yourself.

Hope this answers your question.

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org

Offline

#3 Nov. 14, 2005 01:59:41

M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Uniqueness validation in custom manipulator


Adrian Holovaty wrote:The automatic manipulators set validator_list automatically, to some
automatic validation functions, but if you want to do things like
checking for uniqueness, you'll have to write the validator function
yourself.Understood...The idea was that declaring a field with "unique=True" in a model shouldbe enough for validator to check this uniqueness. I was hoping thatthere is some more public version ofmanipulator_validator_unique_together from core.meta.__init__.py.

Offline

  • Root
  • » Django
  • » Uniqueness validation in custom manipulator [RSS Feed]

Board footer

Moderator control

Enjoy the 18th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support