Monday, April 29, 2013

Store arbitrary key-value pairs in model?

Hi,

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).

Cheers,
Victor

--
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment