Changeset 4336
- Timestamp:
- 01/15/07 18:54:58 (2 years ago)
- Files:
-
- django/branches/newforms-admin/django/contrib/admin/options.py (modified) (2 diffs)
- django/branches/newforms-admin/django/contrib/admin/views/main.py (modified) (4 diffs)
- django/branches/newforms-admin/django/db/models/base.py (modified) (1 diff)
- django/branches/newforms-admin/django/db/models/options.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/newforms-admin/django/contrib/admin/options.py
r4335 r4336 38 38 list_filter = () 39 39 list_select_related = False 40 list_per_page = 100 40 41 search_fields = () 41 42 date_hierarchy = None … … 277 278 try: 278 279 cl = ChangeList(request, self.model, self.list_display, self.list_display_links, self.list_filter, 279 self.date_hierarchy, self.search_fields, self.list_select_related )280 self.date_hierarchy, self.search_fields, self.list_select_related, self.list_per_page) 280 281 except IncorrectLookupParameters: 281 282 # Wacky lookup parameters were given, so redirect to the main django/branches/newforms-admin/django/contrib/admin/views/main.py
r4335 r4336 293 293 294 294 class ChangeList(object): 295 def __init__(self, request, model, list_display, list_display_links, list_filter, date_hierarchy, search_fields, list_select_related ):295 def __init__(self, request, model, list_display, list_display_links, list_filter, date_hierarchy, search_fields, list_select_related, list_per_page): 296 296 self.model = model 297 297 self.opts = model._meta … … 304 304 self.search_fields = search_fields 305 305 self.list_select_related = list_select_related 306 self.list_per_page = list_per_page 306 307 307 308 # Get search parameters from the query string. … … 352 353 353 354 def get_results(self, request): 354 paginator = ObjectPaginator(self.query_set, self.l ookup_opts.admin.list_per_page)355 paginator = ObjectPaginator(self.query_set, self.list_per_page) 355 356 356 357 # Get the number of objects, with admin filters applied. … … 374 375 375 376 can_show_all = result_count <= MAX_SHOW_ALL_ALLOWED 376 multi_page = result_count > self.l ookup_opts.admin.list_per_page377 multi_page = result_count > self.list_per_page 377 378 378 379 # Get the list of objects to display on this page. django/branches/newforms-admin/django/db/models/base.py
r4335 r4336 138 138 cls._meta.ModelAdmin = type('ModelAdmin', (value, ModelAdmin), {}) 139 139 # This AdminOptions stuff is legacy and will eventually be removed. 140 value = AdminOptions(**dict([(k, v) for k, v in value.__dict__.items() if not k.startswith('_') and k not in ('list_display', 'list_display_links', 'list_filter', 'date_hierarchy', 'save_as', 'search_fields', 'list_select_related' )]))140 value = AdminOptions(**dict([(k, v) for k, v in value.__dict__.items() if not k.startswith('_') and k not in ('list_display', 'list_display_links', 'list_filter', 'date_hierarchy', 'save_as', 'search_fields', 'list_select_related', 'list_per_page')])) 141 141 value.contribute_to_class(cls, name) 142 142 elif hasattr(value, 'contribute_to_class'): django/branches/newforms-admin/django/db/models/options.py
r4335 r4336 202 202 def __init__(self, fields=None, js=None, 203 203 ordering=None, 204 save_on_top=False, manager=None , list_per_page=100):204 save_on_top=False, manager=None): 205 205 self.fields = fields 206 206 self.js = js or [] 207 207 self.ordering = ordering 208 208 self.save_on_top = save_on_top 209 self.list_per_page = list_per_page210 209 self.manager = manager or Manager() 211 210
