mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[py3] Removed redundant __str__ methods.
These classes already have an identical __unicode__ method, which will be used after an upcoming refactoring.
This commit is contained in:
		| @@ -419,9 +419,6 @@ class AnonymousUser(object): | |||||||
|     def __unicode__(self): |     def __unicode__(self): | ||||||
|         return 'AnonymousUser' |         return 'AnonymousUser' | ||||||
|  |  | ||||||
|     def __str__(self): |  | ||||||
|         return six.text_type(self).encode('utf-8') |  | ||||||
|  |  | ||||||
|     def __eq__(self, other): |     def __eq__(self, other): | ||||||
|         return isinstance(other, self.__class__) |         return isinstance(other, self.__class__) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -97,9 +97,6 @@ class EasyInstance(object): | |||||||
|             return val[:DISPLAY_SIZE] + '...' |             return val[:DISPLAY_SIZE] + '...' | ||||||
|         return val |         return val | ||||||
|  |  | ||||||
|     def __str__(self): |  | ||||||
|         return self.__unicode__().encode('utf-8') |  | ||||||
|  |  | ||||||
|     def pk(self): |     def pk(self): | ||||||
|         return self.instance._get_pk_val() |         return self.instance._get_pk_val() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -17,9 +17,6 @@ class File(FileProxyMixin): | |||||||
|         if hasattr(file, 'mode'): |         if hasattr(file, 'mode'): | ||||||
|             self.mode = file.mode |             self.mode = file.mode | ||||||
|  |  | ||||||
|     def __str__(self): |  | ||||||
|         return smart_bytes(self.name or '') |  | ||||||
|  |  | ||||||
|     def __unicode__(self): |     def __unicode__(self): | ||||||
|         return smart_text(self.name or '') |         return smart_text(self.name or '') | ||||||
|  |  | ||||||
|   | |||||||
| @@ -85,9 +85,6 @@ class VariableDoesNotExist(Exception): | |||||||
|         self.msg = msg |         self.msg = msg | ||||||
|         self.params = params |         self.params = params | ||||||
|  |  | ||||||
|     def __str__(self): |  | ||||||
|         return six.text_type(self).encode('utf-8') |  | ||||||
|  |  | ||||||
|     def __unicode__(self): |     def __unicode__(self): | ||||||
|         return self.msg % tuple([force_text(p, errors='replace') |         return self.msg % tuple([force_text(p, errors='replace') | ||||||
|                                  for p in self.params]) |                                  for p in self.params]) | ||||||
|   | |||||||
| @@ -18,9 +18,6 @@ class Small(object): | |||||||
|     def __unicode__(self): |     def __unicode__(self): | ||||||
|         return '%s%s' % (force_text(self.first), force_text(self.second)) |         return '%s%s' % (force_text(self.first), force_text(self.second)) | ||||||
|  |  | ||||||
|     def __str__(self): |  | ||||||
|         return six.text_type(self).encode('utf-8') |  | ||||||
|  |  | ||||||
| class SmallField(models.Field): | class SmallField(models.Field): | ||||||
|     """ |     """ | ||||||
|     Turns the "Small" class into a Django field. Because of the similarities |     Turns the "Small" class into a Django field. Because of the similarities | ||||||
|   | |||||||
| @@ -87,9 +87,6 @@ class Team(object): | |||||||
|     def __unicode__(self): |     def __unicode__(self): | ||||||
|         raise NotImplementedError("Not so simple") |         raise NotImplementedError("Not so simple") | ||||||
|  |  | ||||||
|     def __str__(self): |  | ||||||
|         raise NotImplementedError("Not so simple") |  | ||||||
|  |  | ||||||
|     def to_string(self): |     def to_string(self): | ||||||
|         return "%s" % self.title |         return "%s" % self.title | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user