Many thanks Carl, that was most helpful!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send em
Hi jelle,
On Oct 6, 5:34 am, jelle <[EMAIL PROTECTED]> wrote:
> Now, what I'd like to do is to write a validator which will check if a
> ( renamed ) file is already existing. Writing the validator itself
> isnt too hard; I can just use pre_save.connect and call a function
> from here. What I do n
Hi,
I'm working on an asset managment app, that will rename uploaded files
according to a specified nomenclature.
Now, what I'd like to do is to write a validator which will check if a
( renamed ) file is already existing. Writing the validator itself
isnt too hard; I can just use pre_save.connec
I have also read all posts related to a validator here
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from thi
I have read the validator documents
please help me with steps of adding a validator to my FileField.
where do I start? I dont know where to put somthing similar to this
example into my class,
http://www.djangoproject.com/documentation/forms/#Validators
and where to put each bit!
thanks
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
15 matches
Mail list logo