Changeset 1175
- Timestamp:
- 11/11/05 12:10:36 (3 years ago)
- Files:
-
- django/branches/new-admin/django/bin/django-admin.py (modified) (1 diff)
- django/branches/new-admin/django/contrib/admin/templatetags/admin_list.py (modified) (1 diff)
- django/branches/new-admin/django/contrib/admin/templatetags/admin_modify.py (modified) (1 diff)
- django/branches/new-admin/django/core/meta/__init__.py (modified) (2 diffs)
- django/branches/new-admin/docs/outputting_csv.txt (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/new-admin/django/bin/django-admin.py
r1070 r1175 78 78 action = args[0] 79 79 except IndexError: 80 p rint_error("An action is required.", sys.argv[0])80 parser.print_usage_and_exit() 81 81 if not ACTION_MAPPING.has_key(action): 82 82 print_error("Your action, %r, was invalid." % action, sys.argv[0]) django/branches/new-admin/django/contrib/admin/templatetags/admin_list.py
r1159 r1175 156 156 # For non-field list_display values, the value is a method 157 157 # name. Execute the method. 158 func = getattr(result, field_name) 158 159 try: 159 result_repr = str ip_tags(str(getattr(result, field_name)()))160 result_repr = str(func()) 160 161 except ObjectDoesNotExist: 161 162 result_repr = EMPTY_CHANGELIST_VALUE 163 else: 164 # Strip HTML tags in the resulting text, except if the 165 # function has an "allow_tags" attribute set to True. 166 if not getattr(func, 'allow_tags', False): 167 result_repr = strip_tags(result_repr) 162 168 else: 163 169 field_val = getattr(result, f.attname) django/branches/new-admin/django/contrib/admin/templatetags/admin_modify.py
r1169 r1175 31 31 has_delete_permission = context['has_delete_permission'] 32 32 is_popup = context['is_popup'] 33 print is_popup.something34 33 return { 35 34 'onclick_attrib' : (bound_manipulator.ordered_objects and change django/branches/new-admin/django/core/meta/__init__.py
r1160 r1175 266 266 267 267 def get_method_name_part(self): 268 return self.parent_opts.get_rel_object_method_name(self.opts, self.field) 268 # This method encapsulates the logic that decides what name to give a 269 # method that retrieves related many-to-one objects. Usually it just 270 # uses the lower-cased object_name, but if the related object is in 271 # another app, its app_label is appended. 272 # 273 # Examples: 274 # 275 # # Normal case -- a related object in the same app. 276 # # This method returns "choice". 277 # Poll.get_choice_list() 278 # 279 # # A related object in a different app. 280 # # This method returns "lcom_bestofaward". 281 # Place.get_lcom_bestofaward_list() # "lcom_bestofaward" 282 rel_obj_name = self.field.rel.related_name or self.opts.object_name.lower() 283 if self.parent_opts.app_label != self.opts.app_label: 284 rel_obj_name = '%s_%s' % (self.opts.app_label, rel_obj_name) 285 return rel_obj_name 269 286 270 287 class Options: … … 387 404 def get_delete_permission(self): 388 405 return 'delete_%s' % self.object_name.lower() 389 390 def get_rel_object_method_name(self, rel_opts, rel_field):391 # This method encapsulates the logic that decides what name to give a392 # method that retrieves related many-to-one objects. Usually it just393 # uses the lower-cased object_name, but if the related object is in394 # another app, its app_label is appended.395 #396 # Examples:397 #398 # # Normal case -- a related object in the same app.399 # # This method returns "choice".400 # Poll.get_choice_list()401 #402 # # A related object in a different app.403 # # This method returns "lcom_bestofaward".404 # Place.get_lcom_bestofaward_list() # "lcom_bestofaward"405 rel_obj_name = rel_field.rel.related_name or rel_opts.object_name.lower()406 if self.app_label != rel_opts.app_label:407 rel_obj_name = '%s_%s' % (rel_opts.app_label, rel_obj_name)408 return rel_obj_name409 406 410 407 def get_all_related_objects(self):
