Added the irclog django project
[pyIRCbot.git] / irclog / log / models.py
blob3578184f99ecf90485632ba1767df7076626eff5
1 from django.db import models
4 class User(models.Model):
5 nick_name = models.CharField(maxlength=20)
6 first_name = models.CharField(maxlength=14, blank=True)
7 last_name = models.CharField(maxlength=25, blank=True)
8 about = models.TextField(blank=True)
9 homepage = models.URLField(blank=True)
10 email = models.EmailField(maxlength=50, blank=True)
11 avatar = models.ImageField(height_field=50, width_field=50, \
12 upload_to="avatars", blank=True)
14 def __str__(self):
15 return self.nick_name
17 class Admin():
18 pass
21 class Message(models.Model):
22 user_id = models.ForeignKey(User)
23 date = models.DateTimeField(auto_now_add=True)
24 text = models.TextField()
26 class Meta:
27 ordering = ["-date"]
29 def __str__(self):
30 return self.text
32 class Admin():
33 pass