Re: [Django] #15294: Use named urls instead of hard coded ones in admin views

2012-09-24 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
-+-
 Reporter:  julien   |Owner:  ramiro
 Type:  New feature  |   Status:  closed
Component:  contrib.admin|  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by Ramiro Morales ):

 In [changeset:"f51eab796d087439eedcb768cdd312517780940e"]:
 {{{
 #!CommitTicketReference repository=""
 revision="f51eab796d087439eedcb768cdd312517780940e"
 Fixed #18072 -- Made more admin links use reverse() instead of hard-coded
 relative URLs.

 Thanks kmike for the report and initial patch for the changelist->edit
 object view link URL.

 Other affected links include the delete object one and object history
 one (in this case the change had been implemented in commit 5a9e127, this
 commit adds admin-quoting of the object PK in a way similar to a222d6e.)

 Refs #15294.
 }}}

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #15294: Use named urls instead of hard coded ones in admin views

2012-08-26 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
-+-
 Reporter:  julien   |Owner:  ramiro
 Type:  New feature  |   Status:  closed
Component:  contrib.admin|  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by Ramiro Morales ):

 In [5a9e127efc37490b2a1caa605e987a693245b5fa]:
 {{{
 #!CommitTicketReference repository=""
 revision="5a9e127efc37490b2a1caa605e987a693245b5fa"
 Made model instance history admin view link not hard-coded. Refs #15294.
 }}}

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #15294: Use named urls instead of hard coded ones in admin views

2011-12-19 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
-+-
 Reporter:  julien   |Owner:  ramiro
 Type:  New feature  |   Status:  closed
Component:  contrib.admin|  Version:  SVN
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by ramiro):

 In [17237]:
 {{{
 #!CommitTicketReference repository="" revision="17237"
 Stopped unconditionally reversing admin model add/change URLs.

 Starting with [16857] this could cause HTTP 500 errors when
 `ModelAdmin.get_urls()` has been customized to the point it doesn't
 provide these standard URLs.

 Fixes #17333. Refs #15294.
 }}}

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-12-03 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
-+-
 Reporter:  julien   |Owner:  ramiro
 Type:  New feature  |   Status:  closed
Component:  contrib.admin|  Version:  SVN
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by ramiro):

 Replying to [comment:43 ramiro]:
 > Replying to [comment:41 kingtut]:
 > > This is breaking apps that do not have add permissions
 (NoReverseMatch), e.g. django-mailchimp campaigns are always added
 remotely.
 > I've opened #17333 for this.

 .. and I've closed it. ''kingtut'', If you are reading this please help us
 to help you by modifying the regression tes case attached there because I
 can't reproduce your report.

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-12-03 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
-+-
 Reporter:  julien   |Owner:  ramiro
 Type:  New feature  |   Status:  closed
Component:  contrib.admin|  Version:  SVN
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by ramiro):

 Replying to [comment:41 kingtut]:
 > This is breaking apps that do not have add permissions (NoReverseMatch),
 e.g. django-mailchimp campaigns are always added remotely.
 >
 > {{{
 >  if True in perms.values():
 >  info = (app_label, model._meta.module_name)
 >  model_dict = {
 >  'name': capfirst(model._meta.verbose_name_plural),
 > -'admin_url': mark_safe('%s/%s/' % (app_label,
 model.__name__.lower())),
 > +'admin_url': reverse('admin:%s_%s_changelist' % info,
 current_app=self.name),
 > +'add_url': reverse('admin:%s_%s_add' % info,
 current_app=self.name),
 > }}}
 > If the add or change permission is false, why bother resolving the url.
 Perhaps only include the 'add_url' when the 'add' permission exists?
 >
 > Or is is mandatory now that apps implement add, change and delete urls?

 I've opened #17333 for 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] #15294: Use named urls instead of hard coded ones in admin views

2011-10-09 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
-+-
 Reporter:  julien   |Owner:  ramiro
 Type:  New feature  |   Status:  closed
Component:  contrib.admin|  Version:  SVN
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by loewis):

 In [16950]:
 {{{
 #!CommitTicketReference repository="" revision="16950"
 Merged revisions
 
16743,16745,16747-16750,16752-16754,16756-16760,16770,16773-16800,16802-16804,16806,16808,16811,16813,16815,16817-16826,16829-16833,16835-16836,16838-16843,16845-16858,16860-16866,16868,16871-16877,16882-16890,16893-16947
 via svnmerge from
 https://code.djangoproject.com/svn/django/trunk

 
   r16743 | gabrielhurley | 2011-09-09 23:36:58 +0200 (Fr, 09 Sep 2011) | 2
 lines

   Fixed #16791 -- Updated a broken URL in the README file. Thanks to
 paulcwatts for the report and patch.
 
   r16745 | Alex | 2011-09-09 23:45:58 +0200 (Fr, 09 Sep 2011) | 1 line

   Switch to using explicit new-style division behavior, rather than
 relying on teh classic behavior.
 
   r16747 | SmileyChris | 2011-09-10 00:32:38 +0200 (Sa, 10 Sep 2011) | 1
 line

   Fix and test for cleaning a non-string value in a URLField
 
   r16748 | gabrielhurley | 2011-09-10 00:33:28 +0200 (Sa, 10 Sep 2011) | 2
 lines

   Fixed #16786 -- Minor cleanups in the memcached section of the caching
 topic guide. Thanks to jamesp for the report and patch.
 
   r16749 | jbronn | 2011-09-10 00:34:23 +0200 (Sa, 10 Sep 2011) | 1 line

   Fixed #16408 -- Fixed conversion of dates, and other problems with the
 SpatiaLite backend.
 
   r16750 | jbronn | 2011-09-10 00:47:18 +0200 (Sa, 10 Sep 2011) | 1 line

   Removed extra call to `syncdb` that slipped in with r16749.
 
   r16752 | SmileyChris | 2011-09-10 00:57:12 +0200 (Sa, 10 Sep 2011) | 1
 line

   Fixes #16664 -- URLField's to_python method fails with ValueError on
 some urls on python 2.7. Based on patch by zigzag.
 
   r16753 | russellm | 2011-09-10 01:02:33 +0200 (Sa, 10 Sep 2011) | 1 line

   Added two pointless query repeats to work around a known issue with
 MySQL that was causing failures in our test suite.
 
   r16754 | gabrielhurley | 2011-09-10 01:25:48 +0200 (Sa, 10 Sep 2011) | 2
 lines

   Fixed #16782 -- Corrected a broken cross-reference to the database
 engine setting in the tutorial. Thanks to mjumbewu for the report and
 patch.
 
   r16756 | kmtracey | 2011-09-10 02:05:48 +0200 (Sa, 10 Sep 2011) | 2
 lines

   Fixed #15722: ensure formsets evaluate to True even if they have no
 forms. Thanks mlavin.
 
   r16757 | jbronn | 2011-09-10 02:29:34 +0200 (Sa, 10 Sep 2011) | 1 line

   Fixed #13670 -- Comparisons with the spatial adapter won't blow up in
 some corner cases.  Thanks, milosu for the bug report and jpaulett for the
 patch.
 
   r16758 | russellm | 2011-09-10 02:46:38 +0200 (Sa, 10 Sep 2011) | 1 line

   Added protection against spoofing of X_FORWARDED_HOST headers. A
 security announcement will be made shortly.
 
   r16759 | russellm | 2011-09-10 02:46:48 +0200 (Sa, 10 Sep 2011) | 1 line

   Corrected an issue which could allow attackers to manipulate session
 data using the cache. A security announcement will be made shortly.
 
   r16760 | russellm | 2011-09-10 02:47:00 +0200 (Sa, 10 Sep 2011) | 1 line

   Altered the behavior of URLField to avoid a potential DOS vector, and to
 avoid potential leakage of local filesystem data. A security announcement
 will be made shortly.
 
   r16770 | Alex | 2011-09-10 03:53:56 +0200 (Sa, 10 Sep 2011) | 1 line

   Make ``Formset.__getitem__`` O(1), rather than O(n).  If you override
 ``__iter__`` you now need to also override ``__getitem__`` for consistant
 behavior.  Thanks to Carl and Russ for the review.
 
   r16773 | Alex | 2011-09-10 04:42:05 +0200 (Sa, 10 Sep 2011) | 1 line

   Fixed #11404.  Added ``FormSet.has_changed``, for consistancy with
 ``Form.has_changed``. Thanks to michelts for the patch.
 
   r16774 | Alex | 2011-09-10 04:52:37 +0200 (Sa, 10 Sep 2011) | 1 line

   Fixed #16793. Added more cross referencing to the load tag's
 documentation.  Thanks to bluejeansummer for the patch.
 
   r16775 | jbronn | 2011-09-10 05:04:30 +0200 (Sa, 10 Sep 2011) | 1 line

   Fixed #16790 -- Modified the geographic admin to work after r16594.
 Thanks, jdiego, for the bug 

Re: [Django] #15294: Use named urls instead of hard coded ones in admin views

2011-09-25 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
-+-
   Reporter:  julien |  Owner:  ramiro
   Type:  New| Status:  closed
  feature|  Component:  contrib.admin
  Milestone: |   Severity:  Normal
Version:  SVN|   Keywords:
 Resolution:  fixed  |  Has patch:  1
   Triage Stage:  Ready for  |Needs tests:  0
  checkin|  Easy pickings:  0
Needs documentation:  0  |
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-

Comment (by julien):

 Replying to [comment:41 kingtut]:
 > This is breaking apps that do not have add permissions (NoReverseMatch),
 e.g. django-mailchimp campaigns are always added remotely.

 Could you open a new ticket with a failing test case for this? Thanks!

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-09-25 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
-+-
   Reporter:  julien |  Owner:  ramiro
   Type:  New| Status:  closed
  feature|  Component:  contrib.admin
  Milestone: |   Severity:  Normal
Version:  SVN|   Keywords:
 Resolution:  fixed  |  Has patch:  1
   Triage Stage:  Ready for  |Needs tests:  0
  checkin|  Easy pickings:  0
Needs documentation:  0  |
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-

Comment (by kingtut):

 This is breaking apps that do not have add permissions (NoReverseMatch),
 e.g. django-mailchimp campaigns are always added remotely.

 {{{
 if True in perms.values():
 info = (app_label, model._meta.module_name)
 model_dict = {
 'name': capfirst(model._meta.verbose_name_plural),
 'admin_url': mark_safe('%s/%s/' % (app_label,
 model.__name__.lower())),
 'admin_url': reverse('admin:%s_%s_changelist' % info,
 current_app=self.name),
 'add_url': reverse('admin:%s_%s_add' % info,
 current_app=self.name),
 }}}
 If the add or change permission is false, why bother resolving the url.
 Perhaps only include the 'add_url' when the 'add' permission exists?

 Or is is mandatory now that apps implement add, change and delete urls?

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-09-20 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
-+-
   Reporter:  julien |  Owner:  ramiro
   Type:  New| Status:  closed
  feature|  Component:  contrib.admin
  Milestone: |   Severity:  Normal
Version:  SVN|   Keywords:
 Resolution:  fixed  |  Has patch:  1
   Triage Stage:  Ready for  |Needs tests:  0
  checkin|  Easy pickings:  0
Needs documentation:  0  |
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-
Changes (by ramiro):

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


Comment:

 In [16857]:
 {{{
 #!CommitTicketReference repository="" revision="16857"
 Converted internal link generation in the admin and admin document
 generator to use named URLs.

 Thanks to Florian Apolloner for both the initial patch and his final push
 to get
 this fixed, to Dario Ocles for his great work on the admin templates and
 switching the admin_doc application to also use named URLs, to Mikko
 Hellsing
 for his comments and to Jannis and Julien for their review and design
 guidance.

 Fixes #15294.
 }}}

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-09-20 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
-+-
   Reporter:  julien |  Owner:  ramiro
   Type:  New| Status:  new
  feature|  Component:  contrib.admin
  Milestone: |   Severity:  Normal
Version:  SVN|   Keywords:
 Resolution: |  Has patch:  1
   Triage Stage:  Ready for  |Needs tests:  0
  checkin|  Easy pickings:  0
Needs documentation:  0  |
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-

Comment (by ramiro):

 In [16856]:
 {{{
 #!CommitTicketReference repository="" revision="16856"
 Improved test isolation of the admin tests and assigned custom admin sites
 to
 prevent test order dependant failures.

 This involves introducing usage of `TestCase.urls` and implementing proper
 admin.py modules for some of the test apps.

 Thanks Florian Apolloner for finding the issue and contributing the patch.

 Refs #15294 (it solves these problems so the fix for that ticket we are
 going
 to commit doesn't introduce obscure and hard to reproduce test failures
 when
 running the Django test suite.)
 }}}

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-09-18 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
-+-
   Reporter:  julien |  Owner:  ramiro
   Type:  New| Status:  new
  feature|  Component:  contrib.admin
  Milestone: |   Severity:  Normal
Version:  SVN|   Keywords:
 Resolution: |  Has patch:  1
   Triage Stage:  Ready for  |Needs tests:  0
  checkin|  Easy pickings:  0
Needs documentation:  0  |
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-
Changes (by jezdez):

 * stage:  Accepted => Ready for checkin


-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-09-18 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
  UI/UX:  0|
---+---
Changes (by apollo13):

 * needs_better_patch:  1 => 0
 * needs_docs:  1 => 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] #15294: Use named urls instead of hard coded ones in admin views

2011-09-18 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  1|Needs tests:  0
Patch needs improvement:  1|  Easy pickings:  0
  UI/UX:  0|
---+---

Comment (by jezdez):

 `admin_urlname` sounds good +1

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-09-18 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  1|Needs tests:  0
Patch needs improvement:  1|  Easy pickings:  0
  UI/UX:  0|
---+---

Comment (by julien):

 OK, personally my final vote goes to keeping it as a filter and to naming
 it `admin_urlname`. I'm happy to write the doc once an executive decision
 is taken on the name.

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-09-17 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  1|Needs tests:  0
Patch needs improvement:  1|  Easy pickings:  0
  UI/UX:  0|
---+---

Comment (by julien):

 The failures are gone with this new patch, thanks!

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-09-17 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  1|Needs tests:  0
Patch needs improvement:  1|  Easy pickings:  0
  UI/UX:  0|
---+---
Changes (by julien):

 * needs_better_patch:  0 => 1


Comment:

 Great effort cleaning up the admin tests! It looks sane and much more in
 line with best practices. It seems to fix the errors that Ramiro had (and
 which I finally managed to see too) but I'm now getting 2 failures:

 {{{
 ==
 FAIL: testAddView
 (regressiontests.admin_views.tests.AdminViewPermissionsTest)
 Test add view restricts access and actually adds items.
 --
 Traceback (most recent call last):
   File
 
"/Users/julien/Documents/Development/eclipse/workspace/DjangoCore/git/tests/regressiontests/admin_views/tests.py",
 line 863, in testAddView
 'Unrestricted user is not given link to change list view in
 breadcrumbs.')
 AssertionError: True is not False : Unrestricted user is not given link to
 change list view in breadcrumbs.

 ==
 FAIL: test_save_as_display (regressiontests.admin_views.tests.SaveAsTests)
 --
 Traceback (most recent call last):
   File
 
"/Users/julien/Documents/Development/eclipse/workspace/DjangoCore/git/tests/regressiontests/admin_views/tests.py",
 line 600, in test_save_as_display
 self.assertEqual(response.context['form_url'],
 '/test_admin/admin/admin_views/person/add/')
 AssertionError: '../add/' != '/test_admin/admin/admin_views/person/add/'
 }}}


 Also, I've got a slight preference for `admin_url_name` instead of
 `admin_url` simply because that filter does not return a url. Another
 approach could be a new template tag: `{% admin_url opts 'changelist' %}`
 -- It would feel more natural to me, since it's an admin-specific thing.
 I'm not too precious about this though.

 Apart from that, I think it's getting really close now! :-)

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-08-28 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  1|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
  UI/UX:  0|
---+---

Comment (by julien):

 The "model_tag" replacement is very elegant, well done! I'm just a bit
 ambivalent with the name between "admin_url" (shorter and sexier) and
 "admin_url_name" (more explicit and accurate) -- although it's no big deal
 either way.

 Unfortunately I still can't reproduce those test errors with any
 permutations of `generic_inline_admin`, `admin_views` and `comment_tests`.
 However, from what you've described in IRC it does feel like there could
 be some conflicts relating to the order in which the models are registered
 in the admin. Perhaps those errors could be avoided by using a context
 manager:

 {{{#!python
 def test_blah(self):
 with override_admin((MyModel, MyModelAdmin), (MyAwesomeModel,
 MyAwesomeModelAdmin),):
 # Tests go here
 ...
 }}}

 On `__enter__()` the CM would back up potential modeladmins that are
 already registered, then unregister them, then register the ones provided
 as arguments. And on `__exit__()` the CM would re-register the backed up
 modeladmins.

 Just a thought!

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-08-28 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  1|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
  UI/UX:  0|
---+---
Changes (by jezdez):

 * needs_docs:  0 => 1
 * needs_better_patch:  1 => 0


Comment:

 This looks great, yay for not needing a `model_url` tag!

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-08-28 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  1|  Easy pickings:  0
  UI/UX:  0|
---+---

Comment (by apollo13):

 Attached a new diff with the new proposed syntax, needs docs for the new
 filter.

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-08-01 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  1|  Easy pickings:  0
  UI/UX:  0|
---+---

Comment (by ramiro):

 In [16578]:
 {{{
 #!CommitTicketReference repository="" revision="16578"
 Fixed #16542 -- Made Raw ID form widgets shipped with the admin app render
 the related object lookup tool only when the related model is effectively
 registered with the AdminSite.

 Also, converted these widgets to reverse named URLs instead of hard-coded
 '../../...'-style links, refs #15294.
 Thanks Florian Apolloner for the initial patch.
 }}}

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-07-30 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  1|  Easy pickings:  0
  UI/UX:  0|
---+---

Comment (by ramiro):

 In [16575]:
 {{{
 #!CommitTicketReference repository="" revision="16575"
 Removed deprecated admin contrib app AdminSite root_path attribute. Refs
 #15294, r11250, r16136.
 }}}

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-07-07 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  1|  Easy pickings:  0
  UI/UX:  0|
---+---
Changes (by jezdez):

 * ui_ux:   => 0


Comment:

 Hm, so I'm not a big fan of the `model_url` template tag, `{% model_url
 'admin:%s_%s_changelist' opts.app_label opts.module_name %}` doesn't look
 very legible to me, in fact it looks like Pseudo Python. Why not but that
 in the actual Python code instead?

 Other than that this looks pretty awesome.

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-06-04 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  1|  Easy pickings:  0
---+---

Comment (by jezdez):

 Understood, but this is definitely a separate feature, so please open a
 new ticket and remove it from this patch.

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-06-04 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  1|  Easy pickings:  0
---+---

Comment (by burzak):

 jedez, apollo13: The idea of the crumbs block is to avoid many url
 repetition. Inside of many template there are many urls defines on
 breadcrumbs block. When you extend these templates to add some link in
 breadcrumb block, you have to include the urls defines in the template you
 are extending of. With crumbs block you only add the link you want and
 that's it.

 PS: Sorry for my English.

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-06-04 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  1|  Easy pickings:  0
---+---

Comment (by apollo13):

 I agree, wasn't in my inital patch either. Ramiro: any objections against
 removing that again? I there is a compelling reason we could do {% block
 breadcrumbs %}{% block crumbs %} in the base template I guess…

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-06-02 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  1|  Easy pickings:  0
---+---
Changes (by jezdez):

 * needs_better_patch:  0 => 1


Comment:

 What's the purpose of the crumbs block? Isn't that a bit OT for this
 ticket and would make upgrading harder?

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-06-02 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---
Changes (by ramiro):

 * has_patch:  0 => 1


-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-05-26 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---

Comment (by julien):

 Just linking to #5625, which would get fixed by the patch in this ticket.

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-05-04 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---

Comment (by burzak):

 Replying to [comment:18 anonymous]:
 > Another question; can we finally get rid of root_path?

 I think so but I don't know if it is out of scope for this ticket.

 I searched for any ticket related to `root_path` and I didn't find any
 one. If somebody think that getting rid of `root_path` can be include as
 part of this ticket I'll fix it :)

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-05-04 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---

Comment (by anonymous):

 Another question; can we finally get rid of root_path?

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-05-04 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  SVN  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---
Changes (by apollo13):

 * version:  1.2 => SVN


-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-05-04 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  1.2  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---
Changes (by apollo13):

 * cc: florian+django@… (added)


Comment:

 Hey, I am just looking through the diff (will take a deeper look at it
 that weekend) and noticed some inconsistencies:
 https://github.com/ramiro/django/compare/master...bug%2Ft15294#L4R13
 model_url uses "" as quotes while you use '' with url, imo both should be
 "".

 Looking at:
 https://github.com/ramiro/django/compare/master...bug%2Ft15294#L5R36 Do we
 need the '{% if password_change_url %}' at all? The previous version
 always produced an url, so I guess we can just drop the if and put the url
 tag directly into the href attribute. Same for logout url…

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-05-02 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  1.2  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---

Comment (by julien):

 I've just discussed the `post_url_continue` issue with Ramiro on IRC and
 it was decided that it won't be tackled by the work in this ticket. It
 will be done as part of #8001 instead.

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-05-02 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  1.2  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---

Comment (by julien):

 Replying to [comment:13 ramiro]:
 > Am I wrong if I say that comment:4 and comments from comment:6 onwards
 belong in #8001 and not here? Ths ticket is only about making current
 handling on intra-admin site handling of URLs.

 I was wrong in linking this issue to #5925 -- I initially thought that
 `reverse_lazy` may help here, but in fact it can't.

 However, I think that the other comments about `post_url_continue` are
 still relevant (this was even mentioned in the original report). If we can
 find a neat implementation for dealing with `post_url_continue` then that
 would be helpful for #8001 too. But, regardless of #8001, I think we
 should still do something to remove the hardcoded value of
 `post_url_continue` at the same time as the other things in the admin
 views and templates.

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-05-02 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  1.2  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---

Comment (by ramiro):

 Am I wrong if I say that comment:4 and comments from comment:6 onwards
 belong in #8001 and not here? Ths ticket is only about making current
 handling on intra-admin site handling of URLs.

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-05-02 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  1.2  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---

Comment (by julien):

 Replying to [comment:11 burzak]:
 > I like this...
 > {{{
 > #!python
 > if post_url_continue is None:
 > post_url_continue = reverse("admin:%s_%s_change" %
 (opts.app_label, opts.module_name), args=(pk_value,),
 current_app=self.admin_site.name)
 > }}}

 I like this better too. It all depends on whether we're allowing this or
 not (based on the backward compatibility policy). I think it's worth
 breaking compatibility in this case, as it would make the implementation a
 lot cleaner, and the `response_add` method is not documented yet anyway.

 Maybe this is worth asking on the dev-list for other opinions.

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-05-02 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  1.2  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---

Comment (by burzak):

 Replying to [comment:10 julien]:
 > Replying to [comment:8 burzak]:
 > > I did something like that here [0]. I changed the default value to
 None and I made an 'if' like this in order to maintain backward
 compatibility:
 > >
 > > {{{
 > > #!python
 > >
 > > if post_url_continue is not None:
 > > post_url_continue = post_url_continue % pk_value
 > > else:
 > > post_url_continue = reverse("admin:%s_%s_change" %
 (opts.app_label, opts.module_name), args=(pk_value,),
 current_app=self.admin_site.name)
 > > }}}
 >
 > Cool, that makes sense. However, this could be a bit limiting as you
 couldn't pass a pre-formatted string -- it would necessarily require a
 string format to insert `pk_value`.
 >
 > I can think of 2 options, either/or:
 >
 > * we consider that `response_add` is not part of the official API (it's
 not documented) and therefore we don't worry about breaking backwards
 compatibility. We then just assume that `post_url_continue` is either
 `None` or a pre-formatted string.
 > * we first try to insert `pk_value` into `post_url_continue`, but if an
 exception is raised then we assumed it's a pre-formatted string and move
 on with it.
 >
 > Hope that makes sense. What do you think?


 I tend to think that if somebody pass a `post_url_continue` this have to
 be pre-formatted since the user must know where to go.

 I like the idea of keeping the code clean and do not add any try/catch. If
 the backward compatibility is not so much important in this situation I
 would be happy removing the `pk_value`.

 I like this...
 {{{
 #!python
 if post_url_continue is None:
 post_url_continue = reverse("admin:%s_%s_change" %
 (opts.app_label, opts.module_name), args=(pk_value,),
 current_app=self.admin_site.name)
 }}}

 rather than:
 {{{
 #!python
 if post_url_continue is None:
 post_url_continue = reverse("admin:%s_%s_change" %
 (opts.app_label, opts.module_name), args=(pk_value,),
 current_app=self.admin_site.name)
 else:
 try:
 post_url_continue = post_url_continue % pk_value
 except TypeError:
 pass
 }}}

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-05-02 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  1.2  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---

Comment (by julien):

 Replying to [comment:8 burzak]:
 > I did something like that here [0]. I changed the default value to None
 and I made an 'if' like this in order to maintain backward compatibility:
 >
 > {{{
 > #!python
 >
 > if post_url_continue is not None:
 > post_url_continue = post_url_continue % pk_value
 > else:
 > post_url_continue = reverse("admin:%s_%s_change" %
 (opts.app_label, opts.module_name), args=(pk_value,),
 current_app=self.admin_site.name)
 > }}}

 Cool, that makes sense. However, this could be a bit limiting as you
 couldn't pass a pre-formatted string -- it would necessarily require a
 string format to insert `pk_value`.

 I can think of 2 options, either/or:

 * we consider that `response_add` is not part of the official API (it's
 not documented) and therefore we don't worry about breaking backwards
 compatibility. We then just assume that `post_url_continue` is either
 `None` or a pre-formatted string.
 * we first try to insert `pk_value` into `post_url_continue`, but if an
 exception is raised then we assumed it's a pre-formatted string and move
 on with it.

 Hope that makes sense. What do you think?

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-05-02 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  1.2  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---
Changes (by burzak):

 * cc: dario.ocles@… (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 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] #15294: Use named urls instead of hard coded ones in admin views

2011-05-02 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  1.2  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---

Comment (by burzak):

 Replying to [comment:7 julien]:
 > Or probably a better approach is to default `post_url_continue` to
 `None`:
 >
 > {{{
 > #!python
 > def response_add(self, request, obj, post_url_continue=None):
 > ...
 > if post_url_continue is None:
 > post_url_continue = reverse('admin:%s_%s_change' %
 > (opts.app_label, module_name),
 > args=pk_value,
 >
 current_app=self.admin_site.name)
 > ...
 > }}}

 I did something like that here [0]. I changed the default value to None
 and I made an 'if' like this in order to maintain backward compatibility:

 {{{
 #!python

 if post_url_continue is not None:
 post_url_continue = post_url_continue % pk_value
 else:
 post_url_continue = reverse("admin:%s_%s_change" %
 (opts.app_label, opts.module_name), args=(pk_value,),
 current_app=self.admin_site.name)
 }}}

 
https://github.com/burzak/django/commit/cd275d5918aea8ee6d8dc0cdb2c93f2409c87637

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-05-02 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  1.2  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---

Comment (by julien):

 Or probably a better approach is to default `post_url_continue` to `None`:

 {{{
 #!python
 def response_add(self, request, obj, post_url_continue=None):
 ...
 if post_url_continue is None:
 post_url_continue = reverse('admin:%s_%s_change' %
 (opts.app_label, module_name),
 args=pk_value,
 current_app=self.admin_site.name)
 ...
 }}}

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-05-02 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  1.2  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---

Comment (by julien):

 To clarify my comment above about #5925: it was specifically about the
 `post_url_continue` parameter in the `response_add` method's signature:

 {{{
 #!python
 def response_add(self, request, obj, post_url_continue='../%s/'):
 ...
 }}}

 Ideally `post_url_continue` should take the reversed URL for the change
 view instead of the hardcoded `'../%s/'`. Initially I thought that the
 `reverse_lazy()` introduced by #5925 may help, but the problem is that
 there's no way of finding out the new object's pk or even it's app label
 or model name from the method's signature. Maybe an approach would be to
 allow passing a callable as `post_url_continue`, for example:

 {{{
 #!python

 def post_url_continue(request, modeladmin, obj):
 opts = obj._meta
 return reverse('admin:%s_%s_changelist' %
(opts.app_label, opts.module_name),
current_app=modeladmin.admin_site.name)

 class ModelAdmin(BaseModelAdmin):

 ...

 def response_add(self, request, obj,
 post_url_continue=post_url_continue):
 ...
 if callable(post_url_continue):
 post_url_continue = post_url_continue(request, self, obj)
 ...
 }}}

 Such an approach could be generalised for the other redirection urls
 suggested in #8001.

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-04-30 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  ramiro
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  1.2  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---
Changes (by ramiro):

 * owner:  nobody => ramiro


Comment:

 Dario Ocles and me are working on this, see
 https://github.com/ramiro/django/compare/master...bug%2Ft15294

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-04-27 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
---+---
   Reporter:  julien   |  Owner:  nobody
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  1.2  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
---+---
Changes (by julien):

 * easy:   => 0


Comment:

 See #8001 for a related feature request. Also, I think that for the urls
 present in the method signatures we'll have to wait till we get a lazy url
 resolver as proposed in #5925.

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-03-01 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
+--
   Reporter:  julien|Owner:  nobody
 Status:  new   |Milestone:
  Component:  django.contrib.admin  |  Version:  1.2
 Resolution:| Keywords:
   Triage Stage:  Accepted  |Has patch:  0
Needs documentation:  0 |  Needs tests:  0
Patch needs improvement:  0 |
+--

Comment (by ramiro):

 #11163 reported this problem for a specific case: !ForeignKeyRawIdWidget,
 I closed it as duplicate of this one. Will try to update and upload some
 code Florian Apolloner and me had attached to #13588 (changes that were
 correctly marked as out of scope for that ticket, and that dealt precisely
 with what this ticker reports.)

-- 
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] #15294: Use named urls instead of hard coded ones in admin views

2011-02-13 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
+---
   Reporter:  julien| Owner:  nobody
 Status:  new   | Milestone:
  Component:  django.contrib.admin  |   Version:  1.2   
 Resolution:|  Keywords:
   Triage Stage:  Accepted  | Has patch:  0 
Needs documentation:  0 |   Needs tests:  0 
Patch needs improvement:  0 |  
+---
Changes (by russellm):

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


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



[Django] #15294: Use named urls instead of hard coded ones in admin views

2011-02-13 Thread Django
#15294: Use named urls instead of hard coded ones in admin views
--+-
 Reporter:  julien|  Owner:  nobody
   Status:  new   |  Milestone:
Component:  django.contrib.admin  |Version:  1.2   
 Keywords:|   Triage Stage:  Unreviewed
Has patch:  0 |  
--+-
 There are still a lot of hard coded urls in the admin views, generally
 used for redirection. To allow for more flexibility and robustness, those
 should be replaced by named urls. Where it might get tricky is with the
 urls that are provided in the view signatures (for example
 `post_url_continue` in `response_add()`).

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