- Language: en
12 results for isinstance in version 3.2
-
Widgets
- … isinstance ( value , date ): return [ value . day , value . month , value . year ] elif isinstance ( value , str ): year …
-
Serializing Django objects
- … isinstance ( obj , YourCustomType ): return str ( obj ) return super () . default ( obj ) You can then pass cls=LazyEncoder …
-
Model field reference
- … isinstance checks when you need to write code that depends on a field’s functionality …
-
Logging
- … isinstance ( exc_value , UnreadablePostError ): return False return True and then add it to your logging …
-
Django 1.6 release notes
- … isinstance(qs.none(), EmptyQuerySet) If your CSS/JavaScript code used to access HTML input widgets by type …
-
Django 1.10.1 release notes
- … isinstance(field, models.ManyToManyField) since it turned out the checks weren’t suitable to be generalized …
-
File Uploads
- … isinstance ( data , ( list , tuple )): result = [ single_file_clean ( d , initial ) for d in data ] else …
-
Custom template tags and filters
- … isinstance ( value , SafeString ): # Do something with the "safe" string. ... Template filter code falls …
-
The Django admin site
- … isinstance ( inline , MyInline ) or obj is not None : yield inline . get_formset ( request , obj ), inline …
-
Writing custom model fields
- … isinstance ( value , Hand ): return value if value is None : return value return parse_hand ( value …
-
Django 1.7 release notes
- … isinstance ( error_list , self . error_class ): self . _errors [ field ] = self . error_class ( error_list ) Behavior …
-
QuerySet API reference
- … isinstance ( Entry . objects . none (), EmptyQuerySet ) True all() all () Returns a copy of the current QuerySet …