Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force tag to be uppercase #84

Open
MrAlexWinkler opened this issue Dec 17, 2019 · 0 comments
Open

Force tag to be uppercase #84

MrAlexWinkler opened this issue Dec 17, 2019 · 0 comments

Comments

@MrAlexWinkler
Copy link

MrAlexWinkler commented Dec 17, 2019

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant