I’ve never needed a Django model with a name that long, but I don’t think it’s the framework’s place to make those sorts of assumptions if it doesn’t need to, especially for what I see as little to no gain.
On 11 August 2020 at 11:18:49 am, אורי (u...@speedy.net) wrote: How can a class name be more than 100 characters? Can you give an example? A limit of 100 characters seems reasonable to me, maybe even 60 would be enough. אורי u...@speedy.net On Tue, Aug 11, 2020 at 6:06 AM Richard Campen <richard.cam...@gmail.com> wrote: > Hello > > I have hit what I feel is an arbitrary limit on the length of a django > model class name. I am using the PostgreSQL backend, which smartly > truncates table names above a certain size (normally 63 characters) which > means in theory a table name can be of indeterminate length, as PostgreSQL > will truncate it appropriately. However, if the model class name is greater > than 100 characters than an error is thrown when saving the model name to > the `django_content_type` model as the `ContentType.model` field uses a > CharField with a limit of 100. This arbitrarily restricts the size of the > model name when the db backend can handle it fine. > > I tried to go back in time to figure out if there was any context in > setting the `ContentType.model` field max_length at 100 chars, but it was > made before the Django project was migrated to git. > > I feel it would be best to switch this field to a TextField, as even 255 > characters seems an unreasonable limit to impose when the db backend can > support longer names, though perhaps having a smaller (but configurable) > max_length on the TextField would still be desirable. > > What are peoples feelings on this? > > Cheers, > Richard > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-developers+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/26478a0a-5809-449f-b17d-d7223e2cfb3do%40googlegroups.com > <https://groups.google.com/d/msgid/django-developers/26478a0a-5809-449f-b17d-d7223e2cfb3do%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CABD5YeFdA95UhJex%2BERf1pM-groRiUjO5tyLv300wSRjcWkGSQ%40mail.gmail.com <https://groups.google.com/d/msgid/django-developers/CABD5YeFdA95UhJex%2BERf1pM-groRiUjO5tyLv300wSRjcWkGSQ%40mail.gmail.com?utm_medium=email&utm_source=footer> . -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CANK-yknfid%3DcKToiWpnLm3Ky6xoCpXz15a-jeLJobtRgxtvj%3DA%40mail.gmail.com.