Testcase for model with FileField?

2009-03-26 Thread ejot
My model declaration is: class Media(models.Model): binary = models.FileField(upload_to=resolve_file_path) mimetype = models.CharField(max_length=64, editable=False) media_for = models.ForeignKey(Entry) Now if I in my testcase create an instance of Media, how/what do I assign to the '

Database caching, querysets not evaluating?

2007-07-06 Thread ejot
Im really banging my head against a wall trying to get my threaded application to play nice with djangos ORM... this is what my thread does for each iteration.. def run(self): while self.keepRunning: print repr(Topic.objects.get(id=1).content_set.order_by("- id")[0])

Re: Database caching, querysets not evaluating?

2007-07-06 Thread ejot
(from django) applications but suggestions have been to do cron jobs or use views in django to trigger an eventflow. These things aren't always applicable tho, as in my case where i have to keep a connection up on IRC while polling. On Jul 6, 4:50 pm, ejot <[EMAIL PROTECTED]> wrote:

Re: importing users from another db

2007-07-08 Thread ejot
I can answer for the settings part :) Make sure your project is in your PYTHONPATH environment variable and that DJANGO_SETTINGS_MODULE also exists as an environment variable. See http://www.djangoproject.com/documentation/settings/#designating-the-settings On Jul 8, 7:15 am, Carl Karsten <[EMA

Re: Database caching, querysets not evaluating?

2007-07-08 Thread ejot
solve my problem? On Jul 7, 3:08 am, ejot <[EMAIL PROTECTED]> wrote: > Hmm, Im guessing this might also have something to do with local() for > threads? > > Made my app work by using an extra and from my point of view > uneccesary worker thread that does the polling on the database