Changes between Initial Version and Version 1 of Ticket #27519
- Timestamp:
- Nov 21, 2016, 9:32:29 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #27519
- Property Resolution → needsinfo
- Property Status new → closed
-
Ticket #27519 – Description
initial v1 4 4 5 5 Below is one sample model class which I am using in my application, 6 6 {{{ 7 7 class Subgroup(models.Model): 8 8 subgroupname = models.TextField(max_length=50,null=True,blank=True) … … 18 18 class Meta: 19 19 verbose_name_plural = "Subgroups" 20 20 }}} 21 21 22 22 The above model class is returning "Subgroup Name" as a value of that object. We have a our own admin interface area to enter this subgroup name and values for the above model class. If any invalid characters (eg:- '→' ) included in the subgroup name, Django will throw below error, while rendering this subgroup object in Django templates. 23 23 24 == 25 == 26 Error message getting: 27 == 28 == 24 Error message: 29 25 30 ** encoding, errors)\nUnicodeEncodeError: 'ascii' codec can't encode character u'\\u2013' in position 11: ordinal not in range(128)** 26 `** encoding, errors)\nUnicodeEncodeError: 'ascii' codec can't encode character u'\\u2013' in position 11: ordinal not in range(128)**` 31 27 32 28 I think Django doesn't have any in-built error handling if any invalid characters included in the model value.