1 2 3 4 5 | def limitfield (self,obj):
if len(obj.field) < 30:
return obj.field
else:
return obj.field[:26]+'...'
|
More like this
- Unlimited-length CharField by rfugger 1 year ago
- Limit queryset to objects related to parent in ManyToMany fields within admin inlines by DrMeers 1 year, 8 months ago
- JSON View Decorator by bryanpieper 1 year, 7 months ago
- CountryField (UN Country List, 3 Char Codes) by djm 3 years ago
- Dynamically add css-classes to formfields by Lacour 7 months ago
Comments