On Mon, 2006-10-23 at 00:21 +0000, orestis wrote: > Hello, > > I would like to save some arbitrary data that there's no point in > keeping in a database. > > It's just a float number really, that some of my models will use, and > it will be updated using a cron job. It will not presented in a > template, just within some methods of a model. > > What the heck, here's the full description: > > I have defined a next() method that returns the next entry to be > updated. I want this to have a different behavior according to the > state of the data already present in the database. So I have made some > code that analyzes the current data and produces a threshold between 0 > and 1, then I generate random numbers and decide what behavior to > choose depending random()>THRESHOLD. > > The THRESHOLD will be calculated via a cron job - that's not a big > issue. > The issue is, how can I store the new value somewhere so everyone can > just import and use it ? > > Instead of pickling and unpickling, I was wondering if Django has some > datastore for this kind of thing...
Alongside all the other suggestions you have, you can write your own save() method on the model, as noted in the documentation, and write out your attribute value to a file there. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---