Re: [Django] #12028: Generic Inline doesn't validate unique_together

2011-04-28 Thread Django
#12028: Generic Inline doesn't validate unique_together
-+-
   Reporter:  diverman   |  Owner:
   Type:  Bug| Status:  closed
  Milestone:  1.3|  Component:
Version:  1.2|  contrib.contenttypes
 Resolution:  duplicate  |   Severity:  Normal
   Triage Stage:  Design |   Keywords:  content type
  decision needed|  generic inline unique validation
Needs documentation:  0  |  formset admin modeladmin model
Patch needs improvement:  0  |  Has patch:  0
 |Needs tests:  0
 |  Easy pickings:  0
-+-
Changes (by carljm):

 * status:  new => closed
 * resolution:   => duplicate
 * easy:   => 0


Comment:

 Closing as duplicate of #13091, which seems to have become the canonical
 bug for this. It's the same root issue.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12028: Generic Inline doesn't validate unique_together

2011-02-25 Thread Django
#12028: Generic Inline doesn't validate unique_together
--+-
   Reporter:  diverman| Owner:  

 Status:  new | Milestone:  1.3 

  Component:  Contrib apps|   Version:  1.2 

 Resolution:  |  Keywords:  content 
type generic inline unique validation formset admin modeladmin model
   Triage Stage:  Design decision needed  | Has patch:  0   

Needs documentation:  0   |   Needs tests:  0   

Patch needs improvement:  0   |  
--+-

Comment (by ramiro):

 Replying to [comment:9 jnns]:
 > The reason for this exception being raised is that both fields
 `content_type` and `object_id` are being excluded from the inline formset
 as a default. `_get_unique_checks()` omits the excluded fields from
 checking for unique constraints and therefore no ValidationError is raised
 during form validation.
 >
 > I don't know whether a patch is needed or if the form validation should
 be done manually in this case.

 See #13091 for what I think is the root cause of this.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12028: Generic Inline doesn't validate unique_together

2011-02-17 Thread Django
#12028: Generic Inline doesn't validate unique_together
--+-
   Reporter:  diverman| Owner:  

 Status:  new | Milestone:  1.3 

  Component:  Contrib apps|   Version:  1.2 

 Resolution:  |  Keywords:  content 
type generic inline unique validation formset admin modeladmin model
   Triage Stage:  Design decision needed  | Has patch:  0   

Needs documentation:  0   |   Needs tests:  0   

Patch needs improvement:  0   |  
--+-
Changes (by jnns):

 * cc: jvajen@… (added)
  * stage:  Accepted => Design decision needed


Comment:

 The reason for this exception being raised is that both fields
 `content_type` and `object_id` are being excluded from the inline formset
 as a default. `_get_unique_checks()` omits the excluded fields from
 checking for unique constraints and therefore no ValidationError is raised
 during form validation.

 I don't know whether a patch is needed or if the form validation should be
 done manually in this case.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12028: Generic Inline doesn't validate unique_together

2010-11-10 Thread Django
#12028: Generic Inline doesn't validate unique_together
---+
  Reporter:  diverman  | Owner: 
 
Status:  new   | Milestone:  1.3
 
 Component:  Contrib apps  |   Version:  1.2
 
Resolution:|  Keywords:  content type generic 
inline unique validation formset admin modeladmin model
 Stage:  Accepted  | Has_patch:  0  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Changes (by cmarrero):

  * version:  SVN => 1.2
  * milestone:  => 1.3

-- 
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 post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12028: Generic Inline doesn't validate unique_together

2010-08-08 Thread Django
#12028: Generic Inline doesn't validate unique_together
---+
  Reporter:  diverman  | Owner: 
 
Status:  new   | Milestone: 
 
 Component:  Contrib apps  |   Version:  SVN
 
Resolution:|  Keywords:  content type generic 
inline unique validation formset admin modeladmin model
 Stage:  Accepted  | Has_patch:  0  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Comment (by cmarrero):

 this bug is still open, anyone on this ?

-- 
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 post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12028: Generic Inline doesn't validate unique_together

2010-06-18 Thread Django
#12028: Generic Inline doesn't validate unique_together
---+
  Reporter:  diverman  | Owner: 
 
Status:  new   | Milestone: 
 
 Component:  Contrib apps  |   Version:  SVN
 
Resolution:|  Keywords:  content type generic 
inline unique validation formset admin modeladmin model
 Stage:  Accepted  | Has_patch:  0  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Changes (by atli):

  * version:  1.2 => SVN

Comment:

 Replying to [comment:4 johndotnet]:
 > this bug is still open, anyone on this ? what happen to nessita ?

 why the version change? the current svn-state contains this bug, too

-- 
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 post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12028: Generic Inline doesn't validate unique_together

2010-06-17 Thread Django
#12028: Generic Inline doesn't validate unique_together
---+
  Reporter:  diverman  | Owner: 
 
Status:  new   | Milestone: 
 
 Component:  Contrib apps  |   Version:  1.2
 
Resolution:|  Keywords:  content type generic 
inline unique validation formset admin modeladmin model
 Stage:  Accepted  | Has_patch:  0  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Comment (by nessita):

 I unassigned myself from the bug a while back, currently I don't have
 enough time to spend in this issue, sorry :-/

-- 
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 post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12028: Generic Inline doesn't validate unique_together

2010-06-17 Thread Django
#12028: Generic Inline doesn't validate unique_together
---+
  Reporter:  diverman  | Owner: 
 
Status:  new   | Milestone: 
 
 Component:  Contrib apps  |   Version:  1.2
 
Resolution:|  Keywords:  content type generic 
inline unique validation formset admin modeladmin model
 Stage:  Accepted  | Has_patch:  0  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Changes (by johndotnet):

  * version:  SVN => 1.2

Comment:

 this bug is still open, anyone on this ? what happen to nessita ?

-- 
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 post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12028: Generic Inline doesn't validate unique_together

2010-02-24 Thread Django
#12028: Generic Inline doesn't validate unique_together
---+
  Reporter:  diverman  | Owner:  nessita
 
Status:  assigned  | Milestone: 
 
 Component:  Contrib apps  |   Version:  SVN
 
Resolution:|  Keywords:  content type generic 
inline unique validation formset admin modeladmin model
 Stage:  Accepted  | Has_patch:  0  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Changes (by nessita):

  * owner:  nobody => nessita
  * status:  new => assigned

-- 
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 post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12028: Generic Inline doesn't validate unique_together

2010-02-04 Thread Django
#12028: Generic Inline doesn't validate unique_together
---+
  Reporter:  diverman  | Owner:  nobody 
 
Status:  new   | Milestone: 
 
 Component:  Contrib apps  |   Version:  SVN
 
Resolution:|  Keywords:  content type generic 
inline unique validation formset admin modeladmin model
 Stage:  Accepted  | Has_patch:  0  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Changes (by russellm):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 0
  * needs_docs:  => 0

-- 
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 post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #12028: Generic Inline doesn't validate unique_together

2009-10-13 Thread Django
#12028: Generic Inline doesn't validate unique_together
--+
 Reporter:  diverman
  |   Owner:  nobody
   Status:  new 
  |   Milestone:
Component:  Contrib apps
  | Version:  SVN   
 Keywords:  content type generic inline unique validation formset admin 
modeladmin model  |   Stage:  Unreviewed
Has_patch:  0   
  |  
--+
 Hello, consider these models:
 {{{
 ### models.py
 class Tag(models.Model):
 tag = models.CharField(max_length=256)

 class TaggedItem(BaseModel):
 tag = models.ForeignKey('Tag')
 content_type = models.ForeignKey(ContentType)
 object_id = models.PositiveIntegerField(db_index=True)
 content_object = generic.GenericForeignKey()

 class Meta:
 unique_together = (('content_type', 'object_id', 'tag'),)

 class Page(models.Model):
 text = models.TextField()

 ### admin.py
 class TaggedItemInline(generic.GenericTabularInline):
  model = TaggedItem

 class PageAdmin(admin.ModelAdmin):
 inlines = ( TaggedItemInline, )

 admin.site.register(Tag)
 admin.site.register(TaggedItem)
 admin.site.register(Page, PageAdmin)
 }}}

 When I edit Page in Admin and try to set non-unique values, it falls into
 IntegrityError. When I modify TaggedItem in Admin directly, validation of
 unique_together works fine.

 {{{
 Traceback:
 File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in
 get_response
   92. response = callback(request, *callback_args,
 **callback_kwargs)
 File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py" in
 root
   490. return self.model_page(request, *url.split('/', 2))
 File "/usr/lib/python2.5/site-packages/django/views/decorators/cache.py"
 in _wrapped_view_func
   70. response = view_func(request, *args, **kwargs)
 File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py" in
 model_page
   509. return admin_obj(request, rest_of_url)
 File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in
 __call__
   1098. return self.change_view(request, unquote(url))
 File "/usr/lib/python2.5/site-packages/django/db/transaction.py" in
 _commit_on_success
   240. res = func(*args, **kw)
 File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in
 change_view
   833. self.save_formset(request, form, formset,
 change=True)
 File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in
 save_formset
   563. formset.save()
 File "/usr/lib/python2.5/site-packages/django/forms/models.py" in save
   522. return self.save_existing_objects(commit) +
 self.save_new_objects(commit)
 File "/usr/lib/python2.5/site-packages/django/forms/models.py" in
 save_new_objects
   657. self.new_objects.append(self.save_new(form,
 commit=commit))
 File "/usr/lib/python2.5/site-
 packages/django/contrib/contenttypes/generic.py" in save_new
   335. return save_instance(form, new_obj, commit=commit)
 File "/usr/lib/python2.5/site-packages/django/forms/models.py" in
 save_instance
   78. instance.save()
 File "/usr/lib/python2.5/site-packages/django/db/models/base.py" in save
   410. self.save_base(force_insert=force_insert,
 force_update=force_update)
 File "/usr/lib/python2.5/site-packages/django/db/models/base.py" in
 save_base
   495. result = manager._insert(values,
 return_id=update_pk)
 File "/usr/lib/python2.5/site-packages/django/db/models/manager.py" in
 _insert
   177. return insert_query(self.model, values, **kwargs)
 File "/usr/lib/python2.5/site-packages/django/db/models/query.py" in
 insert_query
   1087. return query.execute_sql(return_id)
 File "/usr/lib/python2.5/site-packages/django/db/models/sql/subqueries.py"
 in execute_sql
   320. cursor = super(InsertQuery, self).execute_sql(None)
 File "/usr/lib/python2.5/site-packages/django/db/models/sql/query.py" in
 execute_sql
   2369. cursor.execute(sql, params)
 File "/usr/lib/python2.5/site-packages/django/db/backends/util.py" in
 execute
   19. return self.cursor.execute(sql, params)

 Exception Type: IntegrityError at /admin/web/page/1/
 Exception Value: duplicate key value violates unique constraint
 "tag_taggeditem_content_type_id_key"
 }}}

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