On 04/04/2012, at 11:50 PM, j4nu5 wrote: > Hi Russell, > Thanks for your immense patience :-) > > These are some additions to my proposal above, based on your inputs: > Status of current 'creation' code in django: > The current code, for e.g. sql_create_model in > django.db.backends.creation is a mix of *inspection* part and *sql > generation* part. Since the sql generation part will (should) now be > handled by our new CRUD API, I will refactor > django.db.backends.creation (and other backends' creation modules) to > continue using their inspection part but using our new CRUD API for > sql generation. The approach will be to get the fields using > model._meta.local_fields and feeding them to our new CRUD API. This > will serve to be a proof of concept for my API.
Hrm - not exactly ideal, but better than nothing I suppose. Ideally, there would actually be some migration task involved in your proof of concept. > As for testing using Django code, my models will be something like: > class UnchangedModel(models.Model): > eg = models.TextField() > > if BEFORE_MIGRATION: > class MyModel(models.Model): > f1 = models.TextField() > f2 = models.TextField() > # Deletion of a field > else: > class MyModel(models.Model): > f1 = models.TextField() > > The value of BEFORE_MIGRATION will be controlled by the testing code. > A temporary environment variable can be used for this purpose. Unless your plan also includes writing a lot of extra code to purge and repopulate the app cache, this approach won't work. Just changing a setting doesn't change the class that has already been parsed and processed. > Also a revised schedule: > Bonding period before GSoC: Discussion on API design > Week 1 : Writing tests (using 2 part checks (checking the actual > database and using Django models), as discussed above) > Week 2 : Developing the base migration API > Week 3 : Developing extensions and overrides for PostgreSQL > Weeks 4-5 : Developing extensions and overrides for MySQL > Weeks 6-7 : Developing extensions and overrides for SQLite (may be shorter or > longer (by 0.5 week) depending on how much of xtrqt's code > is > considered acceptable) > Weeks 8-10 : Refactoring django.db backends.creation (and the PostgreSQL, > MySQL, SQLite creation modules) to use the new API for > SQL generation (approach discussed above) > Week 11 : Writing documentaion and leftover tests, if any > Week 12 : Buffer week for the unexpected > This looks a bit more convincing. Yours, Russ Magee %-) -- 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 django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.