init commit

init commit
This commit is contained in:
Trey t
2023-06-11 20:09:22 -05:00
commit a2fd663255
946 changed files with 38811 additions and 0 deletions

0
equipment/__init__.py Normal file
View File

8
equipment/admin.py Normal file
View File

@@ -0,0 +1,8 @@
from django.contrib import admin
from import_export.admin import ImportExportModelAdmin
from .models import *
# Register your models here.
@admin.register(Equipment)
class EquipmentAdmin(ImportExportModelAdmin):
list_display = ("name", "is_weight", "category",)

6
equipment/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class EquipmentConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'equipment'

View File

@@ -0,0 +1,25 @@
# Generated by Django 4.2.2 on 2023-06-11 22:00
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Equipment',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('is_weight', models.BooleanField(default=False)),
('category', models.CharField(blank=True, max_length=64, null=True)),
('name', models.CharField(blank=True, max_length=64, null=True)),
],
),
]

View File

12
equipment/models.py Normal file
View File

@@ -0,0 +1,12 @@
from django.db import models
# Create your models here.
class Equipment(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
is_weight = models.BooleanField(default=False)
category = models.CharField(null=True, blank=True, max_length=64)
name = models.CharField(null=True, blank=True, max_length=64)
def __str__(self):
return self.category + " : " + self.name

7
equipment/serializers.py Normal file
View File

@@ -0,0 +1,7 @@
from rest_framework import serializers
from models import *
class EquipmentSerializer(serializers.ModelSerializer):
class Meta:
model = Equipment
fields = '__all__'

3
equipment/tests.py Normal file
View File

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

3
equipment/views.py Normal file
View File

@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.