Django Quick Start with Schema Evolution Support

Ilias Lazaridis ilias at
Wed Jun 7 17:12:04 CEST 2006

Brian wrote:
> Ilias Lazaridis wrote:
> <snip>
> I would agree with you that this is a place to discuss python.
> However, your posts primarily deal with your expulsion from another
> group.  Instead of discussing that, why don't your discuss the python
> technicalities of your project and leave the rest alone since we want
> to hear about the former and not the later.
> Brian

thank you.



I would like to know, if this construct is valid, or if it can result in 

  	1082	try:
  	1083	    from django.rework.evolve import evolvedb
  	1084	except ImportError:
  	1085	    def evolvedb():
  	1086	        "Evolve Command Dummy"
  	1087	        print 'Command evolvedb not imported'
  	1088	    evolvedb.args =''



A second problem is, how to make the setup for users (testers) more 
convenient. Is there e.g. any mechanism to apply a patch in an automated 
manner (e.g. using a python library)?



The django commands are hard-coded:

thus elegant/dynamic additions of commands seem not possible.

Another possibility is to enlink (hook?) the functionality into an 
existent function

Is there any way (beside a patch) to alter the behaviour to an existing 
function. Is ther a python construct similar to the "alias_method" of Ruby:

(example from an simple evolution support for a ruby orm)

# use "alias_method" to enlink the code

     class SqliteAdapter
         alias_method :old_create_table,  :create_table
         def create_table(*args)
             result = old_create_table(*args)
             return result


If anyone is interested to verify the results in order to stabelize the 
  simple schema evolution support for django, please review the results 



More information about the Python-list mailing list