21 lines
620 B
Python
21 lines
620 B
Python
from django.db import models
|
|
import uuid
|
|
|
|
# Create your models here.
|
|
|
|
def random_url():
|
|
d = uuid.uuid4()
|
|
str = d.hex
|
|
return str[0:16]
|
|
|
|
class Feed(models.Model):
|
|
url = models.URLField(max_length=255)
|
|
element = models.CharField(max_length=255)
|
|
title = models.CharField(max_length=255)
|
|
content = models.CharField(max_length=255)
|
|
date = models.CharField(max_length=255)
|
|
author = models.CharField(max_length=255)
|
|
link = models.CharField(max_length=255)
|
|
creation_date = models.DateTimeField(auto_now=True)
|
|
|
|
uurl = models.CharField(max_length=18, default=random_url, unique=True) |