Re: [Django] #13659: Made the request accessible in callables used in ModelAdmin.list_display [PATCH]

2011-08-19 Thread Django
#13659: Made the request accessible in callables used in ModelAdmin.list_display
[PATCH]
---+---
   Reporter:  sebastian_noack  |  Owner:  nobody
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  1.2  |   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 jedie):

 * cc: django@… (added)
 * 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] #13659: Made the request accessible in callables used in ModelAdmin.list_display [PATCH]

2011-04-21 Thread Django
#13659: Made the request accessible in callables used in ModelAdmin.list_display
[PATCH]
---+---
   Reporter:  sebastian_noack  |  Owner:  nobody
   Type:  New feature  | Status:  new
  Milestone:   |  Component:  contrib.admin
Version:  1.2  |   Severity:  Normal
 Resolution:   |   Keywords:
   Triage Stage:  Accepted |  Has patch:  1
Needs documentation:  1|Needs tests:  0
Patch needs improvement:  1|  Easy pickings:  0
---+---
Changes (by julien):

 * needs_better_patch:  0 => 1
 * easy:   => 0


Comment:

 I think there's a problem with this patch. The `request` parameter in
 `lookup_field` could be `None`, which would happen when called from
 `AdminReadonlyField.contents()`. This means that the callable may receive
 `None` in some cases, which is a shame. The callable should always receive
 the `HTTPRequest` object.

 Also, I think it would make more sense (and be more consistent with the
 way `ModelAdmin`'s methods work) if the request was provided as the first
 argument, e.g.:
 {{{
 def my_function(request, ...):
 ...
 }}}
 or:
 {{{
 def my_method(self, request, ...):
 ...
 }}}
 And finally, I'd prefer the function attribute to be called
 `takes_request`, for consistency with `takes_context` in the
 `inclusion_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] #13659: Made the request accessible in callables used in ModelAdmin.list_display [PATCH]

2010-12-14 Thread Django
#13659: Made the request accessible in callables used in ModelAdmin.list_display
[PATCH]
---+
  Reporter:  sebastian_noack   | Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:  1.2   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  1 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by anonymous):

 * cc: ionel...@gmail.com (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-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] #13659: Made the request accessible in callables used in ModelAdmin.list_display [PATCH]

2010-08-31 Thread Django
#13659: Made the request accessible in callables used in ModelAdmin.list_display
[PATCH]
---+
  Reporter:  sebastian_noack   | Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:  1.2   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  1 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by gabejackson):

 i think it would be better pass request in to the constructor of
 ModelAdmin and create an additional method "get_list_display" so one can
 dynamically set the list_display fields dependent of the request (i.e have
 a different list_display depending on request.user or similar). It might
 be even better to register ModelAdmin objects dynamically based on request
 instead of doing all this conditional get_* overrides in ModelAdmin.
 Another question would be if it's possible to limit access of users to
 certain AdminSites. this would be another solution:
 have multiple AdminSites and register the appropriate ModelAdmins.
 Currently I think that users may log in to any AdminSite though, or am I
 mistaking?

-- 
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] #13659: Made the request accessible in callables used in ModelAdmin.list_display [PATCH]

2010-06-10 Thread Django
#13659: Made the request accessible in callables used in ModelAdmin.list_display
[PATCH]
---+
  Reporter:  sebastian_noack   | Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:  1.2   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  1 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by sebastian_noack):

  * needs_better_patch:  1 => 0
  * needs_tests:  1 => 0

Comment:

 I have updated the patch to django 1.2, renamed needs_request and have
 added a test, 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-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] #13659: Made the request accessible in callables used in ModelAdmin.list_display [PATCH]

2010-06-08 Thread Django
#13659: Made the request accessible in callables used in ModelAdmin.list_display
[PATCH]
---+
  Reporter:  sebastian_noack   | Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:  1.2   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  1 |   Needs_tests:  1 
Needs_better_patch:  1 |  
---+
Comment (by sebastian_noack):

 I agree, the name sounds better, indeed.

-- 
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] #13659: Made the request accessible in callables used in ModelAdmin.list_display [PATCH]

2010-06-08 Thread Django
#13659: Made the request accessible in callables used in ModelAdmin.list_display
[PATCH]
---+
  Reporter:  sebastian_noack   | Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:  1.2   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  1 |   Needs_tests:  1 
Needs_better_patch:  1 |  
---+
Changes (by jacob):

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

Comment:

 Nitpick: I'd name the function attribute `accepts_request` and not
 `needs_request` -- reads better to me. Other than that looks good, but
 needs docs and 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] #13659: Made the request accessible in callables used in ModelAdmin.list_display [PATCH]

2010-05-28 Thread Django
#13659: Made the request accessible in callables used in ModelAdmin.list_display
[PATCH]
---+
  Reporter:  sebastian_noack   | Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:  1.2   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by sebastian_noack):

  * needs_better_patch:  => 0
  * has_patch:  0 => 1
  * 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] #13659: Made the request accessible in callables used in ModelAdmin.list_display [PATCH]

2010-05-28 Thread Django
#13659: Made the request accessible in callables used in ModelAdmin.list_display
[PATCH]
--+-
 Reporter:  sebastian_noack   |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  django.contrib.admin  | Version:  1.2   
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 Its a nice feature of the dajngo admin that you can use names of model or
 model admin methods and plain callables in ModelAdmin.list_display. But I
 want show content in my custom column dependant on the logged in user.
 This isn't possible at the moment. But I have written a patch that passes
 the request object to the given callable or method, when it has the
 needs_request attribute and it is True.

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