#5806: Would like a callback on models.Field during SQL generation
---------------------------------+------------------------------------------
   Reporter:  [EMAIL PROTECTED]  |                Owner:  nobody       
     Status:  new                |            Component:  Uncategorized
    Version:  SVN                |           Resolution:               
   Keywords:                     |                Stage:  Unreviewed   
  Has_patch:  0                  |           Needs_docs:  0            
Needs_tests:  0                  |   Needs_better_patch:  0            
---------------------------------+------------------------------------------
Comment (by anonymous):

 The problem with having to manually executing the SQL statements means
 that they can't be run automatically when a project is installed,
 including when `manage.py test` is run. Not to mention how tedious and
 error-prone it is, compared with (in this case) adding a single
 TsvectorField to each model.

 I actually think that this will help prevent the database API from
 becoming bloated. It will allow users to make use of entire classes of
 features that require additional, custom database statements such as
 these, without having to add APIs for each individual feature.

 This is particularly desirable in cases such as ours, where the actual SQL
 generated is quite specific to our rqeuirements; there are many, many
 different strategies for implementing things such as full-text indexing,
 none of which is suitable for everyone.

 Having done some more thinking about this, I think that rather than
 hijacking the sqlindexes command, a new command such as `sqlextra` should
 be added; this would call each field's `get_sql_extra` method. The
 `sqlextra` command would be called as part of the `sqlall` command.

 I'm happy to work on this myself, of course, but I don't really want to do
 so if I'm going to have to maintain the patch out-of-tree.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5806#comment:3>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to