Mercurial > public > sg101
comparison gpp/core/models.py @ 37:91fd31dc78fb
Removed the database logging stuff. Will replace with Python logging.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 11 Jun 2009 01:00:31 +0000 |
parents | f3ad863505bf |
children | 423c39ee44e0 |
comparison
equal
deleted
inserted
replaced
36:296b610ee507 | 37:91fd31dc78fb |
---|---|
1 """ | 1 """ |
2 This file contains the core Models used in gpp. | 2 This file contains the core Models used in gpp |
3 (None at this time). | |
3 """ | 4 """ |
4 | 5 |
5 from django.db import models | |
6 | |
7 | |
8 class DebugLog(models.Model): | |
9 '''Model to represent debug logs used during development; arbitary text can be stored''' | |
10 | |
11 LOG_LEVELS = ( | |
12 (0, 'Not Set'), | |
13 (10, 'Debug'), | |
14 (20, 'Info'), | |
15 (30, 'Warning'), | |
16 (40, 'Error'), | |
17 (50, 'Critical'), | |
18 ) | |
19 | |
20 timestamp = models.DateTimeField(auto_now_add = True) | |
21 level = models.IntegerField(choices = LOG_LEVELS) | |
22 msg = models.TextField() | |
23 | |
24 def __unicode__(self): | |
25 return '%s - %s' % (self.timestamp.strftime('%m/%d/%Y %H:%M:%S'), | |
26 self.msg[:64]) | |
27 | |
28 class Meta: | |
29 ordering = ('-timestamp', ) |