first commit
This commit is contained in:
0
academia_nuts/__init__.py
Normal file
0
academia_nuts/__init__.py
Normal file
3
academia_nuts/admin.py
Normal file
3
academia_nuts/admin.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
6
academia_nuts/apps.py
Normal file
6
academia_nuts/apps.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class AcademiaNutsConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'academia_nuts'
|
||||
80
academia_nuts/migrations/0001_initial.py
Normal file
80
academia_nuts/migrations/0001_initial.py
Normal file
@@ -0,0 +1,80 @@
|
||||
# Generated by Django 5.1.1 on 2025-02-12 01:39
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Abstract',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.CharField(blank=True, max_length=128, null=True)),
|
||||
('link', models.URLField(blank=True, null=True)),
|
||||
('show_date', models.DateTimeField()),
|
||||
('abstract', models.TextField()),
|
||||
('more_details', models.JSONField(blank=True, null=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'Abstracts',
|
||||
'ordering': ['title'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Tag',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('description', models.TextField(blank=True, null=True)),
|
||||
('slug', models.SlugField()),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'Tags',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Institute',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('website', models.CharField(blank=True, max_length=128, null=True)),
|
||||
('is_venue', models.BooleanField(default=False)),
|
||||
('is_501c', models.BooleanField(default=False)),
|
||||
('contact_name', models.CharField(blank=True, max_length=64, null=True)),
|
||||
('contact_email', models.CharField(blank=True, max_length=64, null=True)),
|
||||
('phone_number', models.CharField(blank=True, max_length=200, null=True)),
|
||||
('address', models.CharField(blank=True, max_length=64, null=True)),
|
||||
('city', models.CharField(blank=True, max_length=32, null=True)),
|
||||
('state', models.CharField(blank=True, max_length=16, null=True)),
|
||||
('zip_code', models.CharField(blank=True, max_length=16, null=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'Institutes',
|
||||
'ordering': ['name'],
|
||||
'unique_together': {('name', 'is_venue')},
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Author',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('author_type', models.CharField(choices=[('Ug', 'Undergrad'), ('Gs', 'Grad Student'), ('Ms', 'Masters'), ('Dr', 'Doctorate')], default='0', max_length=16)),
|
||||
('image', models.ImageField(blank=True, upload_to='promo')),
|
||||
('bio', models.TextField(blank=True, null=True)),
|
||||
('link', models.URLField(blank=True, null=True)),
|
||||
('notes', models.TextField(blank=True, null=True)),
|
||||
('institute', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='academia_nuts.institute')),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'Authors',
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,29 @@
|
||||
# Generated by Django 5.1.1 on 2025-02-12 01:46
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('academia_nuts', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='author',
|
||||
name='institute',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='author',
|
||||
name='image',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='author',
|
||||
name='author_type',
|
||||
field=models.CharField(choices=[('Ug', 'Undergrad'), ('Gs', 'Grad Student'), ('Ms', 'Masters'), ('Dr', 'Doctorate'), ('Ot', 'Other')], default='0', max_length=16),
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='Institute',
|
||||
),
|
||||
]
|
||||
0
academia_nuts/migrations/__init__.py
Normal file
0
academia_nuts/migrations/__init__.py
Normal file
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
|
||||
3
academia_nuts/tests.py
Normal file
3
academia_nuts/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
24
academia_nuts/urls.py
Normal file
24
academia_nuts/urls.py
Normal file
@@ -0,0 +1,24 @@
|
||||
"""ds_events URL Configuration
|
||||
|
||||
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||
https://docs.djangoproject.com/en/4.1/topics/http/urls/
|
||||
Examples:
|
||||
Function views
|
||||
1. Add an import: from my_app import views
|
||||
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
||||
Class-based views
|
||||
1. Add an import: from other_app.views import Home
|
||||
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
||||
Including another URLconf
|
||||
1. Import the include() function: from django.urls import include, path
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import path, include, re_path
|
||||
from .views import *
|
||||
|
||||
urlpatterns = [
|
||||
re_path(r'^abstracts/', AbstractsAPIView.as_view(), name="get-events"),
|
||||
# re_path(r'^promo/', PromoAPIView.as_view(), name="get-promo"),
|
||||
|
||||
]
|
||||
3
academia_nuts/views.py
Normal file
3
academia_nuts/views.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
Reference in New Issue
Block a user