Created
November 5, 2017 22:18
-
-
Save jamesperes-zz/b48dc68eaac6200e13d5e0b09527fcf4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class UserTelegram(models.Model): | |
name = models.CharField(max_length=50) | |
cod = models.CharField(max_length=50) | |
def __str__(self): | |
return self.name | |
class Text(models.Model): | |
user = models.ForeignKey(UserTelegram) | |
text_file = models.TextField() | |
created_at = models.DateTimeField(auto_now_add=True) | |
class Image(models.Model): | |
user = models.ForeignKey(UserTelegram) | |
image_file = models.ImageField(upload_to='uploads') | |
created_at = models.DateTimeField(auto_now_add=True) | |
class Document(models.Model): | |
user = models.ForeignKey(UserTelegram) | |
document_file = models.FileField(upload_to='uploads') | |
created_at = models.DateTimeField(auto_now_add=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment