On Tue, 2007-05-29 at 11:47 -0500, Joseph Kocherhans wrote: > On 5/29/07, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > > > Malcolm's _get_field_sql() question is a good one -- I'm +1 on adding > > that method to the fields. Only thing is, does _get_field_sql() get > > passed the database backend? > > If the method is going in, I think passing in the db backend would be > a great idea along with pushing django.db.backends.X.creation into the > specific field classes.
I'm +1 on passing in the database backend. I'm probably -1 on putting *all* of the creation stuff into field classes, though. The current method, which is like, means that fields do not have to worry about the database, by and large. Only in the case of custom fields with very special creation requirements does the leakage have to happen. I may not have explained this very well, but it smells a little bad to me (deep technical reason, I realise, but without a whiteboard and the ability to wave my arms a bit, it's hard to explain in 250 words or less). There are going to be other opinions, though. One "pie-in-the-sky" reason for my preferring the current way is that it makes replacing the database layer (e.g. SQL Alchemy, rdflib, Fred's Own Fantastic Storage System(tm), ...) cleaner, since there isn't SQL-specific stuff in the Field classes, mostly. I've spent some time over the months wondering how we could add creation for specialised fields without encroaching on the field classes, but I'm not sure it's particularly neat to try and do so. Given the GIS guys' requirements (post-creation modification is necessary), which is also probably the easiest way to add constraints, I guess there's an argument for both _get_field_sql() and _post_create_sql() hooks in there. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---