Author: adrian
Date: 2007-02-25 14:40:10 -0600 (Sun, 25 Feb 2007)
New Revision: 4584

Modified:
   django/branches/newforms-admin/django/contrib/admin/options.py
   django/branches/newforms-admin/django/contrib/admin/views/main.py
Log:
newforms-admin: Renamed ModelAdmin.change_list_queryset() to queryset(), and 
added queryset_add() and queryset_change()

Modified: django/branches/newforms-admin/django/contrib/admin/options.py
===================================================================
--- django/branches/newforms-admin/django/contrib/admin/options.py      
2007-02-25 20:35:32 UTC (rev 4583)
+++ django/branches/newforms-admin/django/contrib/admin/options.py      
2007-02-25 20:40:10 UTC (rev 4584)
@@ -271,9 +271,27 @@
         opts = self.opts
         return request.user.has_perm(opts.app_label + '.' + 
opts.get_delete_permission())
 
-    def change_list_queryset(self, request):
+    def queryset(self, request):
+        """
+        Returns a QuerySet of all model instances that can be edited by the
+        admin site.
+        """
         return self.model._default_manager.get_query_set()
 
+    def queryset_add(self, request):
+        """
+        Returns a QuerySet of all model instances that can be edited by the
+        admin site in the "add" stage.
+        """
+        return self.queryset()
+
+    def queryset_change(self, request):
+        """
+        Returns a QuerySet of all model instances that can be edited by the
+        admin site in the "change" stage.
+        """
+        return self.queryset()
+
     def save_add(self, request, model, form, post_url_continue):
         """
         Saves the object in the "add" stage and returns an 
HttpResponseRedirect.

Modified: django/branches/newforms-admin/django/contrib/admin/views/main.py
===================================================================
--- django/branches/newforms-admin/django/contrib/admin/views/main.py   
2007-02-25 20:35:32 UTC (rev 4583)
+++ django/branches/newforms-admin/django/contrib/admin/views/main.py   
2007-02-25 20:40:10 UTC (rev 4584)
@@ -229,7 +229,7 @@
         self.model = model
         self.opts = model._meta
         self.lookup_opts = self.opts
-        self.root_query_set = model_admin.change_list_queryset(request)
+        self.root_query_set = model_admin.queryset_change(request)
         self.list_display = list_display
         self.list_display_links = list_display_links
         self.list_filter = list_filter


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to