Задать вопрос

Тел: +7 965 3737 888

670

Просмотров

1

Ответов

keeping Model and Field History (everywhere)

<p>Usage:
</p>
class MyModel(ModelWithHistory):
    class History:
        model = True # save model changes into admin's LogEntry table
        fields = ('f1', 'f2') # save these fields history to AttributeLogEntry table
    f1 = CharField(max_length=100)
    f2 = IntegerField()
<p>for threadlocals, see http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
</p>
<p>Aware! Not thoroughly tested yet. May cause problems with loading fixtures.
</p>

Вопрос полезен? Да0/Нет0
file_2933.py(7.8Кб)
None

Ответы (1):

Ответgsf0:29.10.2009
Ответ полезен? Да0/Нет0

Cool I hadn't known about threadlocals. Crazy hacky!