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

Creation of the parent, although max length has been exceeded #350

Open
MaehMaeh opened this issue Feb 14, 2024 · 0 comments
Open

Creation of the parent, although max length has been exceeded #350

MaehMaeh opened this issue Feb 14, 2024 · 0 comments

Comments

@MaehMaeh
Copy link

MaehMaeh commented Feb 14, 2024

I have the problem that when I create a new object via Status.objects.create(code=1, name="12345678901"), I get an error message django.db.utils.DataError: ERROR: Value too long for type character varying(10), but the status object is still created. In my opinion, the status object must not even be created if the max length of name is not correct. Do you have the same problem or is there something wrong with my settings?

Model:

class Status(TranslatableModel):
    code = models.IntegerField(unique=True)
    translations = TranslatedFields(
        name=models.CharField(max_length=10, blank=True),
    )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant