Re: [Django] #13696: Admin Edit Inline templates only output hidden field for PK when inline_admin_form.has_auto_field

2011-12-20 Thread Django
#13696: Admin Edit Inline templates only output hidden field for PK when
inline_admin_form.has_auto_field
-+-
 Reporter:  evan.reiser@…|Owner:  dArignac
 Type:  Bug  |   Status:  reopened
Component:  contrib.admin|  Version:  1.2
 Severity:  Normal   |   Resolution:
 Keywords:  inline templates | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  1|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by issackelly):

 * cc: issac.kelly@… (added)
 * stage:  Accepted => Ready for checkin


Comment:

 Tested against 1.4-pre-alpha and still fixes this 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] #13696: Admin Edit Inline templates only output hidden field for PK when inline_admin_form.has_auto_field

2011-06-09 Thread Django
#13696: Admin Edit Inline templates only output hidden field for PK when
inline_admin_form.has_auto_field
-+-
   Reporter: |  Owner:  dArignac
  evan.reiser@…  | Status:  reopened
   Type:  Bug|  Component:  contrib.admin
  Milestone: |   Severity:  Normal
Version:  1.2|   Keywords:  inline templates
 Resolution: |  Has patch:  1
   Triage Stage:  Accepted   |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  1
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-

Comment (by dArignac):

 Oh ok, sorry, so I got it wrong. Will not happen next time!


 Replying to [comment:13 ramiro]:
 > Replying to [comment:12 dArignac]:
 > > Status changed from assigned to closed
 >
 > Thanks for the patch! But there is no need to close the ticket as
 ''fixed'', the ''has patch'' one is the way to mark it has a fix a fix
 ready for review.
 >
 > ''Fixed'' is used when/if the issue is actually fixed either by applying
 it (or another fix) to the code (by a core committer) . Otherwise it will
 be completely under the radar for people looking for unsolved tickets or
 patches to review and commit, causing effectively the exact  contrary
 effect to the one you intended when you worked in the issue in the first
 place.
 >
 > See https://docs.djangoproject.com/en/dev/internals/contributing
 /triaging-tickets/#closing-tickets

-- 
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] #13696: Admin Edit Inline templates only output hidden field for PK when inline_admin_form.has_auto_field

2011-06-09 Thread Django
#13696: Admin Edit Inline templates only output hidden field for PK when
inline_admin_form.has_auto_field
-+-
   Reporter: |  Owner:  dArignac
  evan.reiser@…  | Status:  reopened
   Type:  Bug|  Component:  contrib.admin
  Milestone: |   Severity:  Normal
Version:  1.2|   Keywords:  inline templates
 Resolution: |  Has patch:  1
   Triage Stage:  Accepted   |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  1
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-
Changes (by ramiro):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Replying to [comment:12 dArignac]:
 > Status changed from assigned to closed

 Thanks for the patch! But there is no need to close the ticket as
 ''fixed'', the ''has patch'' one is the way to mark it has a fix a fix
 ready for review.

 ''Fixed'' is used when/if the issue is actually fixed either by applying
 it (or another fix) to the code (by a core committer) . Otherwise it will
 be completely under the radar for people looking for unsolved tickets or
 patches to review and commit, causing effectively the exact  contrary
 effect to the one you intended when you worked in the issue in the first
 time.

 See https://docs.djangoproject.com/en/dev/internals/contributing/triaging-
 tickets/#closing-tickets

-- 
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] #13696: Admin Edit Inline templates only output hidden field for PK when inline_admin_form.has_auto_field

2011-06-09 Thread Django
#13696: Admin Edit Inline templates only output hidden field for PK when
inline_admin_form.has_auto_field
-+-
   Reporter: |  Owner:  dArignac
  evan.reiser@…  | Status:  closed
   Type:  Bug|  Component:  contrib.admin
  Milestone: |   Severity:  Normal
Version:  1.2|   Keywords:  inline templates
 Resolution:  fixed  |  Has patch:  1
   Triage Stage:  Accepted   |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  1
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-
Changes (by dArignac):

 * status:  assigned => closed
 * has_patch:  0 => 1
 * resolution:   => fixed


-- 
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] #13696: Admin Edit Inline templates only output hidden field for PK when inline_admin_form.has_auto_field

2011-06-09 Thread Django
#13696: Admin Edit Inline templates only output hidden field for PK when
inline_admin_form.has_auto_field
-+-
   Reporter: |  Owner:  dArignac
  evan.reiser@…  | Status:  assigned
   Type:  Bug|  Component:  contrib.admin
  Milestone: |   Severity:  Normal
Version:  1.2|   Keywords:  inline templates
 Resolution: |  Has patch:  0
   Triage Stage:  Accepted   |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  1
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-
Changes (by dArignac):

 * 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-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] #13696: Admin Edit Inline templates only output hidden field for PK when inline_admin_form.has_auto_field

2011-06-09 Thread Django
#13696: Admin Edit Inline templates only output hidden field for PK when
inline_admin_form.has_auto_field
-+-
   Reporter: |  Owner:  dArignac
  evan.reiser@…  | Status:  new
   Type:  Bug|  Component:  contrib.admin
  Milestone: |   Severity:  Normal
Version:  1.2|   Keywords:  inline templates
 Resolution: |  Has patch:  0
   Triage Stage:  Accepted   |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  1
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-
Changes (by dArignac):

 * status:  reopened => new
 * owner:  nobody => dArignac
 * ui_ux:   => 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-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] #13696: Admin Edit Inline templates only output hidden field for PK when inline_admin_form.has_auto_field

2011-04-22 Thread Django
#13696: Admin Edit Inline templates only output hidden field for PK when
inline_admin_form.has_auto_field
-+-
   Reporter: |  Owner:  nobody
  evan.reiser@…  | Status:  reopened
   Type:  Bug|  Component:  contrib.admin
  Milestone: |   Severity:  Normal
Version:  1.2|   Keywords:  inline templates
 Resolution: |  Has patch:  0
   Triage Stage:  Accepted   |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  1
Patch needs improvement:  0  |
-+-
Changes (by evan.reiser@…):

 * easy:   => 1


Comment:

 This is a very easy fix, all you need to do is change this line:

 {{{
 {% if inline_admin_form.has_auto_field %}{{
 inline_admin_form.pk_field.field }}{% endif %}
 }}}

 to this:

 {{{
 {% if inline_admin_form.pk_field %}{{ inline_admin_form.pk_field.field
 }}{% endif %}
 }}}

-- 
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] #13696: Admin Edit Inline templates only output hidden field for PK when inline_admin_form.has_auto_field

2010-12-27 Thread Django
#13696: Admin Edit Inline templates only output hidden field for PK when
inline_admin_form.has_auto_field
+---
  Reporter:  evan.rei...@gmail.com  | Owner:  nobody  
Status:  reopened   | Milestone:  
 Component:  django.contrib.admin   |   Version:  1.2 
Resolution: |  Keywords:  inline templates
 Stage:  Accepted   | Has_patch:  0   
Needs_docs:  0  |   Needs_tests:  0   
Needs_better_patch:  0  |  
+---
Changes (by russellm):

  * stage:  Unreviewed => Accepted

Comment:

 The combination of editable=False and a non-auto primary key field appears
 to be the key here. On first inspection, it looks to me like the inlines
 should be looking for a "is primary key and not editable", rather than "is
 AutoField", as the condition for displaying the hidden ID column.

-- 
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] #13696: Admin Edit Inline templates only output hidden field for PK when inline_admin_form.has_auto_field

2010-11-01 Thread Django
#13696: Admin Edit Inline templates only output hidden field for PK when
inline_admin_form.has_auto_field
+---
  Reporter:  evan.rei...@gmail.com  | Owner:  nobody  
Status:  reopened   | Milestone:  
 Component:  django.contrib.admin   |   Version:  1.2 
Resolution: |  Keywords:  inline templates
 Stage:  Unreviewed | Has_patch:  0   
Needs_docs:  0  |   Needs_tests:  0   
Needs_better_patch:  0  |  
+---
Comment (by wolever):

 As a warning: the “obvious” work around for this is to have custom ID
 fields “pretend” to be auto fields by doing something like this:

 {{{
 def contribute_to_class(...): # XXX BAD XXX
 cls._meta.has_auto_field = True
 ls._meta.auto_field = self
 }}}

 However, this doesn't quite work either, because line 525 of
 `/Users/wolever/Verso/Repos/web/env/massuni-web/lib/python2.6/site-
 packages/django/db/models/base.py` in `save_base`(`update_pk =
 bool(meta.has_auto_field and not pk_set)`), sets the `update_pk` flag,
 which essentially causes:

 {{{
 if update_pk:
 instance.id = get_last_inserted_id()
 }}}

 And, at least with the SQLite backend, the result of
 `get_last_inserted_id` is the row number (or similar), *not* the value of
 the `id` field.

 So, in short, this issue can't be hacked around by setting
 `has_auto_field`.

-- 
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] #13696: Admin Edit Inline templates only output hidden field for PK when inline_admin_form.has_auto_field

2010-10-22 Thread Django
#13696: Admin Edit Inline templates only output hidden field for PK when
inline_admin_form.has_auto_field
+---
  Reporter:  evan.rei...@gmail.com  | Owner:  nobody  
Status:  reopened   | Milestone:  
 Component:  django.contrib.admin   |   Version:  1.2 
Resolution: |  Keywords:  inline templates
 Stage:  Unreviewed | Has_patch:  0   
Needs_docs:  0  |   Needs_tests:  0   
Needs_better_patch:  0  |  
+---
Changes (by wolever):

  * status:  closed => reopened
  * resolution:  invalid =>

Comment:

 For what it's worth, I've been burned by this too.

 To clarify a bit: it occurs when the `id` field is ''not'' an `AutoField`
 ''and'' `editable=False`. To use the example from the documentation:

 {{{
 import random
 from django.db import models as m

 class Author(m.Model):
 name = m.CharField(max_length=100)

 class Book(m.Model):
 id = m.CharField(max_length=32, primary_key=True, editable=False)
 author = m.ForeignKey(Author)
 title = m.CharField(max_length=100)

 def save(self, *args, **kwargs):
 if not self.id:
 self.id = str(random.random())
 super(Book, self).save(*args, **kwargs)
 }}}

 In the `Author` admin page, there is no reference to the `id`s of the
 related `Book`s (clean up a bit):

 {{{
 
   Book object
   
   
 
 }}}

 If this can be confirmed, I'll supply tests.

-- 
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] #13696: Admin Edit Inline templates only output hidden field for PK when inline_admin_form.has_auto_field

2010-06-07 Thread Django
#13696: Admin Edit Inline templates only output hidden field for PK when
inline_admin_form.has_auto_field
+---
  Reporter:  evan.rei...@gmail.com  | Owner:  nobody  
Status:  closed | Milestone:  
 Component:  django.contrib.admin   |   Version:  1.2 
Resolution:  invalid|  Keywords:  inline templates
 Stage:  Unreviewed | Has_patch:  0   
Needs_docs:  0  |   Needs_tests:  0   
Needs_better_patch:  0  |  
+---
Comment (by kmtracey):

 But...it is only !AutoFields that are specifically not part of the form by
 default, so it is only in that case that the admin has to do something
 special to ensure they are on the form. I'm still missing the problem you
 are actually observing, vs. the specifics of the reasons for it that you
 seem to have diagnosed. Could you step back and describe the problem with
 the admin behavior that you are actually seeing? As I said, we have tests
 that verify that inlines with non-auto-field PKs can be added and updated.
 I've also manually verified that myself. I can add and update inlines with
 explicit non-auto character field PKs. I don't see any exceptions raised
 or incorrect data saved. So I am still struggling to understand what
 problem you are observing that would require a change in the admin
 template here.

-- 
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] #13696: Admin Edit Inline templates only output hidden field for PK when inline_admin_form.has_auto_field

2010-06-07 Thread Django
#13696: Admin Edit Inline templates only output hidden field for PK when
inline_admin_form.has_auto_field
+---
  Reporter:  evan.rei...@gmail.com  | Owner:  nobody  
Status:  closed | Milestone:  
 Component:  django.contrib.admin   |   Version:  1.2 
Resolution:  invalid|  Keywords:  inline templates
 Stage:  Unreviewed | Has_patch:  0   
Needs_docs:  0  |   Needs_tests:  0   
Needs_better_patch:  0  |  
+---
Comment (by Evan Reiser ):

 It seems to be that this this problem happens for models which have a
 primary key field that is not based on the AutoField (such as a
 CharField).

 When the primary key field is not based on an AutoField 'has_auto_field'
 is not set to True, therefore it will not output the primary key in the
 form.  (as you can see on line 30 of the tabular.html

 {{{
 {% if inline_admin_form.has_auto_field %}{{
 inline_admin_form.pk_field.field }}{% endif %}
 }}}

 These inline forms should still work for any primary key (in my opinion),
 not only when the field is based on an AutoField.
 You said there area already tests in place to check for this, but
 according to the template, I'm not sure how this would be possible unless
 the field is set to be "has_auto_field" = True.

 It seems that changing line 30 to this fixes the problem:
 {{{

 {% if inline_admin_form.pk_field %}{{ inline_admin_form.pk_field.field
 }}{% endif %}
 }}}

-- 
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] #13696: Admin Edit Inline templates only output hidden field for PK when inline_admin_form.has_auto_field

2010-06-06 Thread Django
#13696: Admin Edit Inline templates only output hidden field for PK when
inline_admin_form.has_auto_field
+---
  Reporter:  evan.rei...@gmail.com  | Owner:  nobody  
Status:  closed | Milestone:  
 Component:  django.contrib.admin   |   Version:  1.2 
Resolution:  invalid|  Keywords:  inline templates
 Stage:  Unreviewed | Has_patch:  0   
Needs_docs:  0  |   Needs_tests:  0   
Needs_better_patch:  0  |  
+---
Changes (by kmtracey):

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

Comment:

 The problem description does not mention what the problem is, exactly. It
 states how some code behaves in a particular circumstance, but leaves out
 what the negative effect of that behavior might be? We have tests that
 verify that inlines with explicit non-auto PK fields can be created,
 saved, edited and saved again in the admin (see
 http://code.djangoproject.com/ticket/13696), so I'm struggling to
 understand what exactly the problem reported here is? What exactly is not
 working properly?

-- 
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] #13696: Admin Edit Inline templates only output hidden field for PK when inline_admin_form.has_auto_field

2010-06-04 Thread Django
#13696: Admin Edit Inline templates only output hidden field for PK when
inline_admin_form.has_auto_field
+---
  Reporter:  evan.rei...@gmail.com  | Owner:  nobody  
Status:  new| Milestone:  
 Component:  django.contrib.admin   |   Version:  1.2 
Resolution: |  Keywords:  inline templates
 Stage:  Unreviewed | Has_patch:  0   
Needs_docs:  0  |   Needs_tests:  0   
Needs_better_patch:  0  |  
+---
Changes (by Evan Reiser ):

 * cc: evan.rei...@gmail.com (added)
  * needs_better_patch:  => 0
  * 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] #13696: Admin Edit Inline templates only output hidden field for PK when inline_admin_form.has_auto_field

2010-06-04 Thread Django
#13696: Admin Edit Inline templates only output hidden field for PK when
inline_admin_form.has_auto_field
---+
 Reporter:  evan.rei...@gmail.com  |   Owner:  nobody
   Status:  new|   Milestone:
Component:  django.contrib.admin   | Version:  1.2   
 Keywords:  inline templates   |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 In my project I'm using a UUID field where I generate the uuid myself in
 python, and don't rely on any sequences on the database side.  Because of
 this I just use a CharField field, and when used i set it to be the
 primary key.  However because of this usage the field does not have
 'has_auto_field' == True, This causes the edit inline forms for existing
 objects to not output the hidden field to hold the PK for the existing
 object.


 Right now this template requires the inline_admin_form.has_auto_field ==
 True, for it to output the pk_field.field, however I think this should
 always output the primary key for the object.

 This line occurs on line 30 of
 contrib/admin/templates/admin/edit_inline/tabular.html in django 1.2.1

 {% if inline_admin_form.has_auto_field %}{{
 inline_admin_form.pk_field.field }}{% endif %}




 contrib/admin/templates/admin/edit_inline/tabular.html
 {{{
 
   {% if inline_admin_form.original or inline_admin_form.show_url
 %}
   {% if inline_admin_form.original %} {{
 inline_admin_form.original }}{% endif %}
   {% if inline_admin_form.show_url %}{% trans "View on site" %}{% endif
 %}
 {% endif %}
   {% if inline_admin_form.has_auto_field %}{{
 inline_admin_form.pk_field.field }}{% endif %}
   {{ inline_admin_form.fk_field.field }}
   {% spaceless %}
   {% for fieldset in inline_admin_form %}
 {% for line in fieldset %}
   {% for field in line %}
 {% if field.is_hidden %} {{ field.field }} {% endif %}
   {% endfor %}
 {% endfor %}
   {% endfor %}
   {% endspaceless %}
 
 }}}

-- 
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.