Django project integration

This commit is contained in:
Mike
2019-11-09 23:28:08 -05:00
parent 5c2d93a9e9
commit 24cc24fb15
14 changed files with 248 additions and 0 deletions

View File

View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

@@ -0,0 +1,5 @@
from django.apps import AppConfig
class InterfaceConfig(AppConfig):
name = 'interface'

View File

@@ -0,0 +1,27 @@
# Generated by Django 2.2.7 on 2019-11-10 03:56
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='books',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=255)),
('author', models.CharField(blank=True, max_length=255)),
('categories', models.CharField(blank=True, max_length=255)),
('cover', models.BinaryField(blank=True, editable=True)),
('pages', models.IntegerField(blank=True)),
('progress', models.IntegerField(blank=True)),
('file_name', models.CharField(max_length=255)),
],
),
]

View File

@@ -0,0 +1,23 @@
from django.db import models
# Create your models here.
class books(models.Model):
"""
pyShelfs Book Database class
:param title: Book title
:param author: Author
:param categories: Categories <-- Not implemented
:param cover: Cover image BinaryField
:param pages: # of pages <-- Not implemented
:param progress: Reader percentage <-- Not implented
:param file_name: Path to book
"""
title = models.CharField(max_length=255)
author = models.CharField(max_length=255, blank=True)
categories = models.CharField(max_length=255, blank=True)
cover = models.BinaryField(blank=True, editable=True)
pages = models.IntegerField(blank=True)
progress = models.IntegerField(blank=True)
file_name = models.CharField(max_length=255, blank=False)

View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@@ -0,0 +1,6 @@
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def index(request):
return HttpResponse("HTTP Request")