yes, it worked. I hadn't seen that part of the model documentation
about the automatically called validators.
thanks!
Babak,
It shouldn't matter. Take a look at django.core.meta.__init__
manipulator_methods[k[len(MANIPULATOR_FUNCTIONS_PREFIX):]] = v
and
_reassign_globals(manipulator_methods, new_mod,
new_mod.__dict__['AddManipulator'])
_reassign_globals(manipulator_methods, new_mod,
new_mod.__dict__['ChangeManip
rob,
well, i'm doing this in a custom form/view. It's not being done by the
site administrator.
Wait, what? I don't think you need to say object.AddManipulator()
Just put that method in your model, and go to the admin interface. It
should work for both adding and changing an object in the model.
-rob
Yes
so:
if I add the above method to my model, it is going to get called
automatically when i do object.AddManipulator()?
I think I get what your saying... I'm going to check it out and see if
it works.
The "tech support" here is amazing. You are you guys aren't
outsourcing to India?
Hi Babak,
I think you can have the cake. Don't mess with CustomManipulators, just
add this method into your model:
def _manipulator_validate_filefield(self, field_data, all_data):
# if file is not the right type
#raise validators.ValidationError, 'Please enter a valid file
type'
On 11/30/05, bsoltani <[EMAIL PROTECTED]> wrote:
> I'm trying to validate a file upload field to make sure that the users
> uploaded file is of a specific type. I know this can be done with a
> custom manipulator (and in turn a custom validator). However, I still
> want to be able to use the def
I'm trying to validate a file upload field to make sure that the users
uploaded file is of a specific type. I know this can be done with a
custom manipulator (and in turn a custom validator). However, I still
want to be able to use the default manipulator for my object for the
rest of the parts
10 matches
Mail list logo