Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>As far as I know, there is no best approach to this task, but I advise you to look into two other options, that has its own pros and contras:</p> <ul> <li><p>Store your user defined data in a <a href="https://github.com/derek-schaefer/django-json-field" rel="nofollow noreferrer">JSONfield</a> or <a href="https://djangosnippets.org/snippets/1694/" rel="nofollow noreferrer">pickled field</a>. This will save you a lot of efforts in writing custom managers and NoSQL. If you are worried about storing it along with your fixed structure data, store it in a separate model with one-to-one relationship in a <a href="http://dev.mysql.com/doc/refman/5.0/en/innodb-multiple-tablespaces.html" rel="nofollow noreferrer">separate InnoDB file</a> for example.</p></li> <li><p>Store yours user data in a generalized <code>(field_id, field_name, content_type)</code> and <code>(object_id, field_id, field_value)</code> dictionaries. They can be split by field types (i.e. <code>int</code>, <code>string</code>, <code>float</code> etc.). This approach won't give you well performing data model from scratch, but smart indexing and <a href="http://dev.mysql.com/doc/refman/5.1/en/partitioning.html" rel="nofollow noreferrer">partitioning</a> can make it worth noting. And your data query, model structure enforcement will be alot easier from other approaches.</p></li> <li><p>If you consider using NoSQL or other db for your mutable content, be sure to choose one that has means for your data efficient querying, see <a href="https://softwareengineering.stackexchange.com/questions/95606/is-there-a-simple-flat-xml-based-query-able-data-storage-solution">this discussion</a> and <a href="http://en.wikipedia.org/wiki/XML_database#XML_Databases_with_database_APIs_.28XQJ.2C_XML%3aDB.2C_RESTful.29" rel="nofollow noreferrer">wiki</a>.</p></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload