first commit
This commit is contained in:
60
academia_nuts/models.py
Normal file
60
academia_nuts/models.py
Normal file
@@ -0,0 +1,60 @@
|
||||
from django.db import models
|
||||
from django.core.files.storage import FileSystemStorage
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
|
||||
class Abstract(models.Model):
|
||||
title = models.CharField(max_length=128, blank=True, null=True)
|
||||
link = models.URLField(blank=True, null=True)
|
||||
show_date = models.DateTimeField()
|
||||
abstract = models.TextField()
|
||||
more_details = models.JSONField(blank=True, null=True)
|
||||
|
||||
class Meta:
|
||||
verbose_name_plural = "Abstracts"
|
||||
ordering = ['title']
|
||||
|
||||
def __unicode__(self):
|
||||
return "%s" % self.show_title
|
||||
|
||||
def __str__(self):
|
||||
return u'%s' % self.show_title
|
||||
|
||||
|
||||
class Author(models.Model):
|
||||
AUTHOR_TYPE = (
|
||||
('Ug', 'Undergrad'),
|
||||
('Gs', 'Grad Student'),
|
||||
('Ms', 'Masters'),
|
||||
('Dr', 'Doctorate'),
|
||||
('Ot', 'Other')
|
||||
)
|
||||
name = models.CharField(max_length=64)
|
||||
author_type = models.CharField(max_length=16, choices=AUTHOR_TYPE, default='0')
|
||||
bio = models.TextField(blank=True, null=True)
|
||||
link = models.URLField(blank=True, null=True)
|
||||
notes = models.TextField(blank=True, null=True)
|
||||
|
||||
class Meta:
|
||||
verbose_name_plural = "Authors"
|
||||
|
||||
def __unicode__(self):
|
||||
return "%s" % self.name
|
||||
|
||||
def __str__(self):
|
||||
return u'%s' % self.name
|
||||
|
||||
|
||||
class Tag(models.Model):
|
||||
name = models.CharField(max_length=64)
|
||||
description = models.TextField(blank=True, null=True)
|
||||
slug = models.SlugField()
|
||||
|
||||
class Meta:
|
||||
verbose_name_plural = "Tags"
|
||||
|
||||
def __unicode__(self):
|
||||
return "%s" % self.name
|
||||
|
||||
def __str__(self):
|
||||
return u'%s' % self.name
|
||||
Reference in New Issue
Block a user