I'm writing a review of my Django experience, and there's something I
want to fact-check before I complain about it.
Is there a way to "catch" a property change so I can run some code at
the time?
Example:
class Entry(models.Model):
...
post_date = models.DateTimeField(...)
On Dec 12, 5:50 am, Rob Young <[EMAIL PROTECTED]> wrote:
> How do I go about mocking the database for efficiently unit testing my models?
> When writing my own projects I would simply create a mock db interface but if
> I'm using Django I'd like to do things 'the Django way' rather than hacking
>
On Dec 12, 1:02 am, "Adrian Holovaty" <[EMAIL PROTECTED]> wrote:
> You can simply write a set_posted() method, like so:
>
> class Entry(models.Model):
> post_date = models.DateTimeField(...)
> posted = models.BooleanField(...)
>
> def set_posted(self, new_value):
> if new_value
3 matches
Mail list logo