django-tagulous
django-tagulous copied to clipboard
Force tag to be uppercase
Hey Richard, awesome work on this package. I've been playing around with it for a few weeks now and recently wanted to make 1 of my models using tagulous all uppercase.
What would be the best solution for that?
Was thinking about adding "def save" to my class based on this stack answer https://stackoverflow.com/questions/36330677/django-model-set-default-charfield-in-lowercase
class Symbol(models.Model):
name = SingleTagField(max_length=10)
def save(self, *args, **kwargs):
self.name = self.name.upper()
return super(Symbol, self).save(*args, **kwargs)
But I got "'Tagulous_Symbol_name' object has no attribute 'upper'" as an error.
In your documentation, I see the "force_lowercase" - which is a bit of the opposite of what I'm looking for plus. I don't want this to be global but just for the specific model. http://radiac.net/projects/django-tagulous/documentation/tag_options/#option_force_lowercase
I hope I explained the situation okay, sorry I'm still a bit new here. Thanks for your help and this package!