==== Patch <django-content-type-verbose-name> level 2
Source: f4626db1-382e-0410-8594-a82d82b39f71:/content-type-verbose-name:5613 [local]
Target: bcc190cf-cafb-0310-a4f2-bffc1f526a37:/django/trunk:5643 [mirrored]
(http://code.djangoproject.com/svn/django)
Log:
r5611@damasonium: ddanier | 2007-07-10 14:37:23 +0200
* model_verbose_name() and model_verbose_name_plural() as methods of ContentType
=== django/contrib/contenttypes/models.py
==================================================================
|
|
|
51 | 51 | from django.db import models |
52 | 52 | return models.get_model(self.app_label, self.model) |
53 | 53 | |
| 54 | def model_verbose_name(self): |
| 55 | "Returns the verbose name of the model." |
| 56 | return self.model_class()._meta.verbose_name |
| 57 | |
| 58 | def model_verbose_name_plural(self): |
| 59 | "Returns the verbose name (plural) of the model." |
| 60 | return self.model_class()._meta.verbose_name_plural |
| 61 | |
54 | 62 | def get_object_for_this_type(self, **kwargs): |
55 | 63 | """ |
56 | 64 | Returns an object of this type for the keyword arguments given. |