Changes between Version 3 and Version 4 of AppEngine


Ignore:
Timestamp:
Feb 9, 2009, 3:41:20 AM (16 years ago)
Author:
Waldemar Kornewald
Comment:

clarification of m2m rels

Legend:

Unmodified
Added
Removed
Modified
  • AppEngine

    v3 v4  
    7979Many-to-many relations could be emulated with a !ListProperty(db.Key), so you can at least issue simple queries, but this can quickly hit the 5000 index entries limit. The alternative of having an intermediate table is useless if you have to issue queries on the data and due to the query limit you wouldn't be able to retrieve more than 1000 related entities, anyway.
    8080
    81 The problem with many-to-many relations is that, for example, ModelForm saves the model instance and and its many-to-many relations in separate steps. With !ListProperty this would cause multiple write operations. One solution is to use batch operations as described above, but this at least means that most existing code won't work.
     81The problem with many-to-many relations is that, for example, ModelForm saves the model instance and and its many-to-many relations in separate steps. With !ListProperty this would cause multiple write operations. Also, depending on where the many-to-many relation is defined the changes could affect multiple models at once. One solution is to use batch operations as described above, but this means that all existing many-to-many code has to be optimized. Since this should be transaction-safe the field would have to be defined on a specific model, so that only one entity is affected when adding multiple relations. This means that Django has to make it easy to add new fields to existing models.
    8282
    8383== Special field types ==
Back to Top