Monday, April 29, 2013

Store arbitrary key-value pairs in model?


I have a Django application that will need to store arbitraty

Basically, there are a series of "job scripts" that are submitted by users and then run.

Each of these jobs scripts may have an arbitrary number of key-value pairs attached to them (for example, output directory, or search term, or email address etc.).

There variables are then used by each script. The set of variables varies for each job script.

Is there an easy way to model this within Django?

We could store a serialised dict as a blob, but that sounds rather hackish.

I was thinking a document database (e.g. MongoDB, or Couch DB) might be more suitable, however, I'd like to keep it within Django, if possible (Django and relational DBs are widely used where I am, and there's good support for them).


You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment