Re: what do you think about django FORM system?

2015-03-06 Thread younger.shen
Hello everyone:


you may have your own opinions, i read the letters all above , the point of
why i think the form of django is hard to use  is that the form do 2 kinds
of things , first is to build html , secnod is to validate , i never build
html in backend it is not good practice , and i really only need to
validate input nothing else , form did not support easy validate method,
such as when i use django form to validate my form , then i got a error
message , i only want a plain text messge , but use the  as_text() method
then , i found a * in the string ,  i need to slice the string , i thought
what happend to django form , i cant understand the point what the author
thought.

every key to every locked *DREAM* 

2015-03-07 7:39 GMT+08:00 john :

>
> On 03/06/2015 12:28 PM, felix wrote:
>
>> I'm using Django 1.9 and Bootstrap v3.3.1
>>
> I did know there was a Django 1.9
>
> I tried several ways but whatever I was doing the form field size did not
> change for me.  But I started using crispy-forms and using their layout
> stuff allowed everything I needed.  That said, I could be the real issue as
> I'm not best python programmer and worse with html and javascript.
>
> BTW my comment was about how the doc's did not really help me.  I think a
> person can say - that something I did in some of area was the cause of the
> issue and I wouldn't open my mouth.  Yet, when reviewing the doc's I got a
> very different impression of what was available for me to do with generic
> Django forms.
>
>
> Johnf
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/54FA3A9B.6080800%40jfcomputer.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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFp8GA%2BUOAhwrYGv_2U%3DkL%2BL-v3MxA5V2D2gAphAXgXJQNpdvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: what do you think about django FORM system?

2015-03-06 Thread john


On 03/06/2015 12:28 PM, felix wrote:
I'm using Django 1.9 and Bootstrap v3.3.1 

I did know there was a Django 1.9

I tried several ways but whatever I was doing the form field size did 
not change for me.  But I started using crispy-forms and using their 
layout stuff allowed everything I needed.  That said, I could be the 
real issue as I'm not best python programmer and worse with html and 
javascript.


BTW my comment was about how the doc's did not really help me.  I think 
a person can say - that something I did in some of area was the cause of 
the issue and I wouldn't open my mouth.  Yet, when reviewing the doc's I 
got a very different impression of what was available for me to do with 
generic Django forms.



Johnf

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54FA3A9B.6080800%40jfcomputer.com.
For more options, visit https://groups.google.com/d/optout.


Re: what do you think about django FORM system?

2015-03-06 Thread felix

El 06/03/15 11:22, john escribió:
I saws that to in the Doc's - it did not work for me with bootstrap.  
I did not find the cause - if there wasn't some sort of bug.  I'm 
using Django 1.7.5 so I'll guess and say it had something to do with 
the interaction of the two.  I have moved on to crispy-forms and all 
seems to work.  But like I said at the start - in answer to the 
question "Could you provide us more in-deapth of your feeling using 
the django form?"  I found the information provided from the doc's to 
be confusing and did not explain why I had to subclass.  More examples 
are needed (and all in one doc - not link after link after link).  
Maybe what I'm asking for is for the tutorial to better explain the 
use and ways to mod the form code to get things done.


I guess you only need to subclass a widget if you want to change 
appearance and behavior of all instances.
I'm using Django 1.9 and Bootstrap v3.3.1 and I've just tried the 
example using a CharField in a form like this and worked!


class SearchElementForm(forms.Form):
q = forms.CharField(label='Search', max_length=30, 
widget=forms.TextInput(attrs={'size': '40'}))


I wasn't using the size attribute at all but when I tried, it was 
displayed with a different size every time I changed the size.



Felix

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54FA0E05.9010406%40epepm.cupet.cu.
For more options, visit https://groups.google.com/d/optout.


Re: what do you think about django FORM system?

2015-03-06 Thread john
I saws that to in the Doc's - it did not work for me with bootstrap.  I 
did not find the cause - if there wasn't some sort of bug.  I'm using 
Django 1.7.5 so I'll guess and say it had something to do with the 
interaction of the two.  I have moved on to crispy-forms and all seems 
to work.  But like I said at the start - in answer to the question 
"Could you provide us more in-deapth of your feeling using the django 
form?"  I found the information provided from the doc's to be confusing 
and did not explain why I had to subclass.  More examples are needed 
(and all in one doc - not link after link after link).  Maybe what I'm 
asking for is for the tutorial to better explain the use and ways to mod 
the form code to get things done.


Johnf
On 03/06/2015 08:02 AM, felix wrote:

El 06/03/15 10:20, john escribió:
OK I realize you are saying I should read the doc's.  So I will 
provide exactly what I'm saying from the doc's.


Django handles three distinct parts of the work involved in forms:

  * preparing and restructuring data ready for rendering
  * creating HTML forms for the data
  * receiving and processing submitted forms and data from the client

It is/possible/to write code that does all of this manually, but 
Django can take care of it all for you.


I read the above and I say why do I need to subclass anything. 
CharField is provided and that's all I really need because it's just 
a few chars the user is going to enter.  But I need to provide an ID, 
a SIZE, a few things - where is that info and where are the 
examples?  Maybe I missed them?  I've been know to mis-read stuff.



something like this you mean?

class  CommentForm(forms.Form):
 name  =  forms.CharField(widget=forms.TextInput(attrs={'class':  
'special'}))
 url  =  forms.URLField()
 comment  =  forms.CharField(widget=forms.TextInput(attrs={'size':  '40'}))

Cheers,
Felix.

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54F9CFA3.2010708%40epepm.cupet.cu 
.

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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54F9D442.4040905%40jfcomputer.com.
For more options, visit https://groups.google.com/d/optout.


Re: what do you think about django FORM system?

2015-03-06 Thread felix

El 06/03/15 10:20, john escribió:
OK I realize you are saying I should read the doc's.  So I will 
provide exactly what I'm saying from the doc's.


Django handles three distinct parts of the work involved in forms:

  * preparing and restructuring data ready for rendering
  * creating HTML forms for the data
  * receiving and processing submitted forms and data from the client

It is/possible/to write code that does all of this manually, but 
Django can take care of it all for you.


I read the above and I say why do I need to subclass anything. 
CharField is provided and that's all I really need because it's just a 
few chars the user is going to enter.  But I need to provide an ID, a 
SIZE, a few things - where is that info and where are the examples?  
Maybe I missed them?  I've been know to mis-read stuff.



something like this you mean?

class  CommentForm(forms.Form):
name  =  forms.CharField(widget=forms.TextInput(attrs={'class':  
'special'}))
url  =  forms.URLField()
comment  =  forms.CharField(widget=forms.TextInput(attrs={'size':  '40'}))

Cheers,
Felix.


--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54F9CFA3.2010708%40epepm.cupet.cu.
For more options, visit https://groups.google.com/d/optout.


Re: what do you think about django FORM system?

2015-03-06 Thread john
OK I realize you are saying I should read the doc's.  So I will provide 
exactly what I'm saying from the doc's.


Django handles three distinct parts of the work involved in forms:

 * preparing and restructuring data ready for rendering
 * creating HTML forms for the data
 * receiving and processing submitted forms and data from the client

It is/possible/to write code that does all of this manually, but Django 
can take care of it all for you.


I read the above and I say why do I need to subclass anything. CharField 
is provided and that's all I really need because it's just a few chars 
the user is going to enter.  But I need to provide an ID, a SIZE, a few 
things - where is that info and where are the examples?  Maybe I missed 
them?  I've been know to mis-read stuff.


Johnf



On 03/06/2015 07:12 AM, felix wrote:

El 06/03/15 09:38, john escribió:
I can tell you what I found to be hard to understand (and I don't 
think I do understand at the moment) that is how to set the HTML, the 
types, ID, and any of the special attributes of the object.  I 
understand that I can sub-class but it's also my understanding that I 
shouldn't have too.  For example I want to use the new HTML 5 
type=month.  I'd also like to use size but so far I haven't 
determined how.  I did get the validation working.




Maybe a look at Rendering fields manually in the Forms section of the 
doc might be helpful.

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54F9C3E2.7050007%40epepm.cupet.cu 
.

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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54F9C5A2.3070600%40jfcomputer.com.
For more options, visit https://groups.google.com/d/optout.


Re: what do you think about django FORM system?

2015-03-06 Thread john
OK for example how can I set the size of "widget"?  What I really want 
is some doc that provides an example - I've searched with no results.  I 
ended up with using a real HTML on the template along with the rest of 
the django objects.

Johnf

On 03/06/2015 07:03 AM, aRkadeFR wrote:

So you're problem is not about forms but widgets.

The widget are the object that render a field form. You can subclass
it to render it in anyway you want.

What do you don't like in subclassing a widget/model ?

On 03/06/2015 03:38 PM, john wrote:
I can tell you what I found to be hard to understand (and I don't 
think I do understand at the moment) that is how to set the HTML, the 
types, ID, and any of the special attributes of the object.  I 
understand that I can sub-class but it's also my understanding that I 
shouldn't have too.  For example I want to use the new HTML 5 
type=month.  I'd also like to use size but so far I haven't 
determined how.  I did get the validation working.


Johnf

On 03/06/2015 02:43 AM, aRkadeFR wrote:

Hello

It's pretty easy to use django forms after reading the docs.
And django form are well integrated with the whole django framework.
You have multiple layers of cleaning the form, from the widget to 
the model, and

I love that.

Could you provide us more in-deapth of your feeling using the django 
form?

What are the problem? Or what do you expect from it?

Thanks

On 03/06/2015 11:37 AM, younger.shen wrote:

Hello everyone:

i use django since last year, and now i can not stand the django 
form any more, hard to use , especially custom error message , i 
use laravel for php development , and validator of laravel is very 
easy to use and very clean code , so i hack a small plugin .


https://github.com/youngershen/django-laravel-validator

i want your opinion my friends.  talk to me please , what is your 
opinion about django form.



every key to every locked *DREAM* 
--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFp8GAKe7r7PWzBbFMsLk6PuR863-QU5%3D%2Bv%2BGQ4uA_yihFh3dw%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54F984E9.2070701%40arkade.info 
.

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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54F9BBCD.3070408%40jfcomputer.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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54F9C1D7.6020007%40arkade.info 
.

For more options, visit 

Re: what do you think about django FORM system?

2015-03-06 Thread felix

El 06/03/15 09:38, john escribió:
I can tell you what I found to be hard to understand (and I don't 
think I do understand at the moment) that is how to set the HTML, the 
types, ID, and any of the special attributes of the object.  I 
understand that I can sub-class but it's also my understanding that I 
shouldn't have too.  For example I want to use the new HTML 5 
type=month.  I'd also like to use size but so far I haven't determined 
how.  I did get the validation working.




Maybe a look at Rendering fields manually in the Forms section of the 
doc might be helpful.


--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54F9C3E2.7050007%40epepm.cupet.cu.
For more options, visit https://groups.google.com/d/optout.


Re: what do you think about django FORM system?

2015-03-06 Thread aRkadeFR

So you're problem is not about forms but widgets.

The widget are the object that render a field form. You can subclass
it to render it in anyway you want.

What do you don't like in subclassing a widget/model ?

On 03/06/2015 03:38 PM, john wrote:
I can tell you what I found to be hard to understand (and I don't 
think I do understand at the moment) that is how to set the HTML, the 
types, ID, and any of the special attributes of the object.  I 
understand that I can sub-class but it's also my understanding that I 
shouldn't have too.  For example I want to use the new HTML 5 
type=month.  I'd also like to use size but so far I haven't determined 
how.  I did get the validation working.


Johnf

On 03/06/2015 02:43 AM, aRkadeFR wrote:

Hello

It's pretty easy to use django forms after reading the docs.
And django form are well integrated with the whole django framework.
You have multiple layers of cleaning the form, from the widget to the 
model, and

I love that.

Could you provide us more in-deapth of your feeling using the django 
form?

What are the problem? Or what do you expect from it?

Thanks

On 03/06/2015 11:37 AM, younger.shen wrote:

Hello everyone:

i use django since last year, and now i can not stand the django 
form any more, hard to use , especially custom error message , i use 
laravel for php development , and validator of laravel is very easy 
to use and very clean code , so i hack a small plugin .


https://github.com/youngershen/django-laravel-validator

i want your opinion my friends.  talk to me please , what is your 
opinion about django form.



every key to every locked *DREAM* 
--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFp8GAKe7r7PWzBbFMsLk6PuR863-QU5%3D%2Bv%2BGQ4uA_yihFh3dw%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54F984E9.2070701%40arkade.info 
.

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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54F9BBCD.3070408%40jfcomputer.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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54F9C1D7.6020007%40arkade.info.
For more options, visit https://groups.google.com/d/optout.


Re: what do you think about django FORM system?

2015-03-06 Thread john
I can tell you what I found to be hard to understand (and I don't think 
I do understand at the moment) that is how to set the HTML, the types, 
ID, and any of the special attributes of the object.  I understand that 
I can sub-class but it's also my understanding that I shouldn't have 
too.  For example I want to use the new HTML 5 type=month.  I'd also 
like to use size but so far I haven't determined how.  I did get the 
validation working.


Johnf

On 03/06/2015 02:43 AM, aRkadeFR wrote:

Hello

It's pretty easy to use django forms after reading the docs.
And django form are well integrated with the whole django framework.
You have multiple layers of cleaning the form, from the widget to the 
model, and

I love that.

Could you provide us more in-deapth of your feeling using the django form?
What are the problem? Or what do you expect from it?

Thanks

On 03/06/2015 11:37 AM, younger.shen wrote:

Hello everyone:

i use django since last year, and now i can not stand the django form 
any more, hard to use , especially custom error message , i use 
laravel for php development , and validator of laravel is very easy 
to use and very clean code , so i hack a small plugin .


https://github.com/youngershen/django-laravel-validator

i want your opinion my friends.  talk to me please , what is your 
opinion about django form.



every key to every locked *DREAM* 
--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFp8GAKe7r7PWzBbFMsLk6PuR863-QU5%3D%2Bv%2BGQ4uA_yihFh3dw%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54F984E9.2070701%40arkade.info 
.

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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54F9BBCD.3070408%40jfcomputer.com.
For more options, visit https://groups.google.com/d/optout.


Re: what do you think about django FORM system?

2015-03-06 Thread felix

El 06/03/15 05:37, younger.shen escribió:

Hello everyone:

i use django since last year, and now i can not stand the django form 
any more, hard to use , especially custom error message , i use 
laravel for php development , and validator of laravel is very easy to 
use and very clean code , so i hack a small plugin .


https://github.com/youngershen/django-laravel-validator

i want your opinion my friends.  talk to me please , what is your 
opinion about django form.


I, definitevely, like django forms. They are easy to use and validation 
is similar to model validation. It just takes a thing: reading the doc.


--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54F9AFF8.7030100%40epepm.cupet.cu.
For more options, visit https://groups.google.com/d/optout.


Re: what do you think about django FORM system?

2015-03-06 Thread Tom Evans
On Fri, Mar 6, 2015 at 10:37 AM, younger.shen  wrote:
> Hello everyone:
>
> i use django since last year, and now i can not stand the django form any
> more, hard to use , especially custom error message , i use laravel for php
> development , and validator of laravel is very easy to use and very clean
> code , so i hack a small plugin .
>
> https://github.com/youngershen/django-laravel-validator
>
> i want your opinion my friends.  talk to me please , what is your opinion
> about django form.

I prefer django forms to that style. Each time the form is generated
it must determine what the options are for a field by parsing strings,
which is ugly.

If you don't invest time in to learning how django's forms work, you
will always prefer a form system you already understand. As an
example, this is your RegistValidator as a django form:

class RegistValidator(forms.Form):
email = forms.EmailField()
password = forms.PasswordField(min_length=8)
password_confirm = forms.PasswordField(min_length=8)
captcha_0 = forms.CharField()
captcha_1 = forms.CharField()

def clean(self):
data = super(RegistValidator, self).clean()
if data['password'] != data['password_confirm']:
self.add_error('password', u'密码不匹配')
try:
CaptchaStore.objects.get(
response=data['captcha_1'],
hashkey=data['captcha_0'],
expiration__gt=get_safe_now()).delete()
except CaptchaStore.DoesNotExist:
self.add_error('captcha_0', u'验证码错误')
self.add_error('captcha_1', u'验证码错误')

def clean_email(self):
if User.objects.filter(email=self.cleaned_data['email']).exists():
raise forms.ValidationError(u'该用户已存在')

Cheers

Tom

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1Li4%3Dujpbsn8EJ-kKF_x%2BjkB4_LvzqTbw1Lkp%3D4r7A8wA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: what do you think about django FORM system?

2015-03-06 Thread aRkadeFR

Hello

It's pretty easy to use django forms after reading the docs.
And django form are well integrated with the whole django framework.
You have multiple layers of cleaning the form, from the widget to the 
model, and

I love that.

Could you provide us more in-deapth of your feeling using the django form?
What are the problem? Or what do you expect from it?

Thanks

On 03/06/2015 11:37 AM, younger.shen wrote:

Hello everyone:

i use django since last year, and now i can not stand the django form 
any more, hard to use , especially custom error message , i use 
laravel for php development , and validator of laravel is very easy to 
use and very clean code , so i hack a small plugin .


https://github.com/youngershen/django-laravel-validator

i want your opinion my friends.  talk to me please , what is your 
opinion about django form.



every key to every locked *DREAM* 
--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFp8GAKe7r7PWzBbFMsLk6PuR863-QU5%3D%2Bv%2BGQ4uA_yihFh3dw%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54F984E9.2070701%40arkade.info.
For more options, visit https://groups.google.com/d/optout.


what do you think about django FORM system?

2015-03-06 Thread younger.shen
Hello everyone:

i use django since last year, and now i can not stand the django form any
more, hard to use , especially custom error message , i use laravel for php
development , and validator of laravel is very easy to use and very clean
code , so i hack a small plugin .

https://github.com/youngershen/django-laravel-validator

i want your opinion my friends.  talk to me please , what is your opinion
about django form.


every key to every locked *DREAM* 

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFp8GAKe7r7PWzBbFMsLk6PuR863-QU5%3D%2Bv%2BGQ4uA_yihFh3dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.