On 12/17/08, Russell Keith-Magee <[email protected]> wrote:
>
> On Wed, Dec 17, 2008 at 9:30 PM, James PIC <[email protected]> wrote:
> >
> > Is it worth reporting the bug?
>
> However, at a guess, I'm going to say that the problem has been caused
> by your choice of model names. You appear to have named one of your
> models something like TypedEInformationComplementaireContact. This is
> a pretty long class name, and it is overflowing a column somewhere
> that is using the class name as a starting point.
> Your proposed fix (increasing the size of the columns) is really just
> deferring the problem.
(I did not actually propose it, but used it to describe the problem).
> No matter what maximum size we pick, someone
> will choose a model name that will overflow it. I would have thought a
> 50 character limit was plenty, but obviously I was wrong. Your
> solution also suffers from the problem of backwards compatibility -
> there is a lot of existing code out there that relies on the existing
> size definition.
>
> A better solution would be to come up with a name munging scheme that
> guaranteed to give unique permission names that will always fit into
> the available space. 50 characters is plenty to establish a unique
> name; we already perform a similar munging with the names for database
> constraints.
That would be much smarter indeed!
> Of course, the simplest solution is for you to pick shorter class
> names, and for us to document the limitation.
I can change "Information" to "Info", but you have the point that it doesn't
fix the problem ... I just wanted to point it out.
> This solution has the
> additional benefit of enforcing good programming practice. Having
> descriptive class names is good, but I for one wouldn't derive much
> joy from using an API that had class names that spanned 50% of the
> width of a 80 character terminal :-)
Just for kidding:
class Lot(Mandat, Bien, PourLocation, PourVente, LotAddresse,
AvecEquipementsAnnexes, Textes, Immeuble):
It was that, or models with thousands of similar fields, high WTF/hour :)
Regards, James.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---