models.py 481 Bytes
Newer Older
1
from django.db import models
Jean Michel Rouly's avatar
Jean Michel Rouly committed
2
3
from django.contrib.auth.models import User
from django.utils import timezone
4
5

# Create your models here.
Jean Michel Rouly's avatar
Jean Michel Rouly committed
6
7
8
9
10
11
12
class URL( models.Model ):
    owner = models.OneToOneField( User )
    date_created = models.DateTimeField( default=timezone.now() )

    target = models.CharField( max_length = 1000 )
    short = models.CharField( max_length = 50 )
    clicks = models.IntegerField( default = 0 )
13
    expires = models.DateTimeField( blank = True, null = True )