Re: [Django] #25766: adding javascript "this.disabled" invalidate ManyToManyField

2015-11-17 Thread Django
#25766: adding javascript "this.disabled" invalidate ManyToManyField
---+--
 Reporter:  liwee  |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  contrib.admin  |  Version:  1.7
 Severity:  Normal |   Resolution:  needsinfo
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by timgraham):

 I think this is covered by #16730.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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


Re: [Django] #25766: adding javascript "this.disabled" invalidate ManyToManyField

2015-11-17 Thread Django
#25766: adding javascript "this.disabled" invalidate ManyToManyField
---+--
 Reporter:  liwee  |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  contrib.admin  |  Version:  1.7
 Severity:  Normal |   Resolution:  needsinfo
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by liwee):

 I added the javascript to prevent multiple button clicks; Whilst
 submitting credit card details for payment, some sites disable the submit
 button to prevent multiple payments, I am just trying to mimic that
 behaviour.

 If you comment {{{filter_horizontal = ('qn',)}}} and try again, saving
 will not cause a problem. Originally, I had the impression that it was a
 problem with ManyToManyField because I was able to save other fields
 without a problem.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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


Re: [Django] #25766: adding javascript "this.disabled" invalidate ManyToManyField

2015-11-17 Thread Django
#25766: adding javascript "this.disabled" invalidate ManyToManyField
---+--
 Reporter:  liwee  |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  contrib.admin  |  Version:  1.7
 Severity:  Normal |   Resolution:  needsinfo
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by timgraham):

 * status:  new => closed
 * resolution:   => needsinfo


Comment:

 It's not clear to me how or why this is a bug in Django. It seems to me
 that `onClick="this.disabled=true; this.form.submit();"` is something that
 you or a third-party package you are using added.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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


Re: [Django] #25766: adding javascript "this.disabled" invalidate ManyToManyField

2015-11-16 Thread Django
#25766: adding javascript "this.disabled" invalidate ManyToManyField
---+--
 Reporter:  liwee  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  1.7
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by liwee):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Old description:

> With just models.py and admin.py, I was able to save a poll without any
> problems.
> But if you add onClick="this.disabled=true; this.form.submit()", trying
> to save the poll will cause a problem.
>
> submit_line.html
>
> {{{
> {% if show_save_and_continue %}{% endif %}
> }}}
>

>
> models.py
>
> {{{
> from django.db import models
>
> class Question(models.Model):
> qn = models.CharField(max_length=200)
>
> def __unicode__(self):
> return self.qn
>
> class Poll(models.Model):
> name = models.CharField(max_length=200)
> qn = models.ManyToManyField(Question)
>
> }}}
>
> admin.py
>
> {{{
> from django.contrib import admin
> from .models import *
>
> class PollAdmin(admin.ModelAdmin):
> filter_horizontal = ('qn',)
>
> admin.site.register(Poll, PollAdmin)
> admin.site.register(Question)
> }}}

New description:

 With just models.py and admin.py, I was able to save a poll without any
 problems.
 But if you add onClick="this.disabled=true; this.form.submit()", even if
 you try to add qn to the poll, it will not get saved


 submit_line.html

 {{{
 {% if show_save_and_continue %}{% endif %}
 }}}



 models.py

 {{{
 from django.db import models

 class Question(models.Model):
 qn = models.CharField(max_length=200)

 def __unicode__(self):
 return self.qn

 class Poll(models.Model):
 name = models.CharField(max_length=200)
 qn = models.ManyToManyField(Question)

 }}}

 admin.py

 {{{
 from django.contrib import admin
 from .models import *

 class PollAdmin(admin.ModelAdmin):
 filter_horizontal = ('qn',)

 admin.site.register(Poll, PollAdmin)
 admin.site.register(Question)
 }}}

--

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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