orms.ValidationError(("FIELD VALUE already exist"))
On Sat, Apr 27, 2013 at 6:41 PM, isachin wrote:
> @ Kelly: thank you very much for pointing me to django's source code.
>
> Yes I got that validation done and applied the same code for validation.
> Below is the snippet
@ Kelly: thank you very much for pointing me to django's source code.
Yes I got that validation done and applied the same code for validation.
Below is the snippet :
profile.serial_num = self.cleaned_data['phone_num']
try:
profile._default_manager.get(phone_num=profile.seri
Thanx Siddharth and Pradeep, I will try both suggestion and let you know
On Thu, Apr 25, 2013 at 2:07 PM, Pradeep Kumar wrote:
> Hi Sachin,
>
> If you have added the unique=True later and migrated the existing table, I
> would also suggest you to first clean up the NULL and duplicate entries
>
Thanx,
Btw, I solved it by creating an instance of get_profile() and then saving
user and profile separately.
here is the code snippet of *forms.py*
if commit:
profile = user.get_profile()
profile.serial_num = self.cleaned_data['serial_num']
profile.save()
user.sa
4 matches
Mail list logo