Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > HTTP (WWW)

    django-mutant 0.0.1

    Download button

    No screenshots available
    Downloads: 107  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Simon Charette | More programs
    MIT/X Consortium Lic... / FREE
    February 29th, 2012, 15:55 GMT
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    django-mutant description

    Dynamic model definition and alteration (evolving schemas)

    django-mutant is a Django app that provides a great ORM and with the power of South one can easily perform schema alteration.

    However, some projects may require runtime schema alteration and that's what django-mutant provides.

    The main concept was inspired by those projects:

    - Will Hardy dynamic-models with doc and talk.
    - And even more by django-dynamo

    Direction of the project

    The project is still in an early phase but a couple of complex things already works such as declaration of RelatedField (ForeignKey, ManyToManyField) between models and an easy way of declaring subclasses of FieldDefinition which allow any Field subclass to be be represented easily:

    class DateFieldDefinition(FieldDefinition):
     auto_now = fields.BooleanField(_(u'auto now'), default=False)
     auto_now_add = fields.BooleanField(_(u'auto_now_add'), default=False)

     class Meta:
     app_label = 'mutant'
     defined_field_class = fields.DateField
     defined_field_options = ('auto_now', 'auto_now_add',)
     defined_field_category = _(u'datetime')


    This approach also allows projects such as django-non-rel to be truly useful since both your schema and your ORM wrapper around it are flexible.

    As a paranoid (see Will Hardy DjangoCon2011 talk at 21:40 about missing columns) I'm currently working on a locking mechanism to avoid having threads sharing obsolete model class. The main idea is the following, when a thread (say request) fetch a model definition it subscribes to this model. When another thread want's to modify a definition it blocks other threads from subscribing and wait until all other threads that subscribed to this model finish (this way there's only one thread with a reference to the model and that's the one that modifies it). When the modification is completed, the lock is released and blocked subscribers get the fresh version. It gets a bit a harder when modifying model with relations since we want to avoid deadlocks but I think it's a sane approach.

    Get in touch and contribute

    From now on I think the best way to contribute and get in touch is using github messaging system (issues and push request). If more discussions needs to take place I might consider opening a google group and/or IRC.


    Product's homepage

    Requirements:

    · Python
    · Django

      


    TAGS:

    model definition | model alteration | evolving schemas | model | definition | alteration

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM