Re: Automatically adding http:// to a URLField

2006-11-16 Thread [EMAIL PROTECTED]
Thanks - I guess I will have to add the extra validator. Any chance you would know how to write one for this (i.e. how to add the validator to the model, and then pass it back to the default validator once it's done?) canen wrote: > On Nov 15, 2:45 pm, "Julio Nobrega" <[EMAIL PROTECTED]> wrote: >

Re: Automatically adding http:// to a URLField

2006-11-15 Thread Jay Parlar
You could also set a 'default' value for the field, something like default="http://"; Then it will be prepopulated, which would help a little. Jay P. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Automatically adding http:// to a URLField

2006-11-15 Thread canen
On Nov 15, 2:45 pm, "Julio Nobrega" <[EMAIL PROTECTED]> wrote: > Override the save method on your model to check if the "http://"; > string is not in the self.field_name, and if it's not, add it. > http://www.djangoproject.com/documentation/model_api/#overriding-defa... > If it fails validati

Re: Automatically adding http:// to a URLField

2006-11-15 Thread Julio Nobrega
Override the save method on your model to check if the "http://"; string is not in the self.field_name, and if it's not, add it. http://www.djangoproject.com/documentation/model_api/#overriding-default-model-methods On 11/15/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hey, > > Am

Automatically adding http:// to a URLField

2006-11-15 Thread [EMAIL PROTECTED]
Hey, Am trying to use a URLField in my app, but if the user doesn't stick http:// on the front of it, it fails vaildation. Is there a way to automatically add one if one isn't present - rather than it just failing validation? Many Thanks, Oliver --~--~-~--~~~---~--~