Re: Form validations

2019-07-11 Thread Charles Wright
It sounds to me like you may want to use validators for your form.  Here
are two links that might help you out:

https://stackoverflow.com/questions/17165147/how-can-i-make-a-django-form-field-contain-only-alphanumeric-characters


https://docs.djangoproject.com/en/2.2/ref/validators/

On Thu, Jul 11, 2019 at 8:06 AM Jani Tiainen  wrote:

> Hi.
>
> Usually you validate user input and by using Forms or ModelForms.
>
>
> to 11. heinäk. 2019 klo 12.50 Irfan Khan  kirjoitti:
>
>> Dear members,
>> I wanted to validate the form which contains the name, phone number,
>> address,email, etc..,
>> I have developed and tested it if we give any character it’s saving to
>> database table.so I wanted to validate the every field for example
>> In name field it should take only alphabets,
>> And in phone number field it should take only numbers like
>> Can any one please guide me which is best practice to perform
>> Thanks in advance
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CALKGViqQgLhqAzPgG5S-sz4ZdwA2z_q6KeTUQoxtNrzrrA21sQ%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHn91oephj3rT2JoJZaGk5MtSfdJV0Bcb1j9jngE99YW5VyFng%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF35uzdu9X34kOwo3YtNF_mnv%3Dib%3DTPCMpZzCSwH%3DXUHgEWCAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Form validations

2019-07-11 Thread Khaleel Ahmed H. M. Shariff
Yes you could validate user input using regular expression. Explore the re
module.
Best of luck
God Bless

On Thu, 11 Jul 2019, 11:22 p.m. Irfan Khan,  wrote:

> Yeah currently I do have modelforms but I need to know using regular
> expression can we done
>
> On Thu, 11 Jul 2019 at 6:36 PM, Jani Tiainen  wrote:
>
>> Hi.
>>
>> Usually you validate user input and by using Forms or ModelForms.
>>
>>
>> to 11. heinäk. 2019 klo 12.50 Irfan Khan  kirjoitti:
>>
>>> Dear members,
>>> I wanted to validate the form which contains the name, phone number,
>>> address,email, etc..,
>>> I have developed and tested it if we give any character it’s saving to
>>> database table.so I wanted to validate the every field for example
>>> In name field it should take only alphabets,
>>> And in phone number field it should take only numbers like
>>> Can any one please guide me which is best practice to perform
>>> Thanks in advance
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CALKGViqQgLhqAzPgG5S-sz4ZdwA2z_q6KeTUQoxtNrzrrA21sQ%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAHn91oephj3rT2JoJZaGk5MtSfdJV0Bcb1j9jngE99YW5VyFng%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALKGViqbjbsdg0tFjZLAkrLazd2YMVQohj66eMMDSwjA-d0chg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMjBbiDq7_559Kbf-6_t%3DeFzWcyODGHhpGnkv5mf8CZRcVbXfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Form validations

2019-07-11 Thread Irfan Khan
Yeah currently I do have modelforms but I need to know using regular
expression can we done

On Thu, 11 Jul 2019 at 6:36 PM, Jani Tiainen  wrote:

> Hi.
>
> Usually you validate user input and by using Forms or ModelForms.
>
>
> to 11. heinäk. 2019 klo 12.50 Irfan Khan  kirjoitti:
>
>> Dear members,
>> I wanted to validate the form which contains the name, phone number,
>> address,email, etc..,
>> I have developed and tested it if we give any character it’s saving to
>> database table.so I wanted to validate the every field for example
>> In name field it should take only alphabets,
>> And in phone number field it should take only numbers like
>> Can any one please guide me which is best practice to perform
>> Thanks in advance
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CALKGViqQgLhqAzPgG5S-sz4ZdwA2z_q6KeTUQoxtNrzrrA21sQ%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHn91oephj3rT2JoJZaGk5MtSfdJV0Bcb1j9jngE99YW5VyFng%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALKGViqbjbsdg0tFjZLAkrLazd2YMVQohj66eMMDSwjA-d0chg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Form validations

2019-07-11 Thread Jani Tiainen
Hi.

Usually you validate user input and by using Forms or ModelForms.


to 11. heinäk. 2019 klo 12.50 Irfan Khan  kirjoitti:

> Dear members,
> I wanted to validate the form which contains the name, phone number,
> address,email, etc..,
> I have developed and tested it if we give any character it’s saving to
> database table.so I wanted to validate the every field for example
> In name field it should take only alphabets,
> And in phone number field it should take only numbers like
> Can any one please guide me which is best practice to perform
> Thanks in advance
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALKGViqQgLhqAzPgG5S-sz4ZdwA2z_q6KeTUQoxtNrzrrA21sQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHn91oephj3rT2JoJZaGk5MtSfdJV0Bcb1j9jngE99YW5VyFng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.