first
This commit is contained in:
commit
d731fb6608
486 files changed
+251018
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class AdminConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'admin'
|
||||
Whitespace-only changes.
@@ -0,0 +1,99 @@
|
||||
from django.db import models
|
||||
|
||||
|
||||
class User(models.Model):
|
||||
UserTypeList = [
|
||||
('admin', 'admin'),
|
||||
('office', 'office'),
|
||||
('operator', 'operator'),
|
||||
]
|
||||
user_name = models.CharField(max_length=50)
|
||||
password = models.CharField(max_length=50)
|
||||
user_type = models.CharField(
|
||||
max_length=10,
|
||||
choices=UserTypeList
|
||||
)
|
||||
name_family = models.CharField(max_length=200)
|
||||
create_date = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
class Customer(models.Model):
|
||||
name_family = models.CharField(max_length=200)
|
||||
address = models.CharField(max_length=200)
|
||||
create_date = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
class PhoneNumber(models.Model):
|
||||
customer = models.ForeignKey(Customer, on_delete=models.CASCADE)
|
||||
phone_number = models.CharField(max_length=11)
|
||||
|
||||
class StoreRoom(models.Model):
|
||||
store_name = models.CharField(max_length=200)
|
||||
|
||||
class ProductCategory(models.Model):
|
||||
category_name = models.CharField(max_length=50)
|
||||
|
||||
class Product(models.Model):
|
||||
ProductCategory = models.ForeignKey(ProductCategory, on_delete=models.CASCADE)
|
||||
product_name = models.CharField(max_length=50)
|
||||
product_price = models.IntegerField()
|
||||
|
||||
class ProductInStore(models.Model):
|
||||
StoreRoom = models.ForeignKey(StoreRoom, on_delete=models.CASCADE)
|
||||
Product = models.ForeignKey(Product, on_delete=models.CASCADE)
|
||||
inventory = models.IntegerField()
|
||||
|
||||
class Factor(models.Model):
|
||||
customer = models.ForeignKey(Customer, on_delete=models.CASCADE)
|
||||
create_date = models.DateTimeField(auto_now_add=True)
|
||||
amount = models.IntegerField()
|
||||
discount = models.IntegerField()
|
||||
deadline = models.DateTimeField()
|
||||
statusList = [
|
||||
('unpaid', 'unpaid'),
|
||||
('paid', 'paid'),
|
||||
('cancell', 'cancell'),
|
||||
]
|
||||
pay_status = models.CharField(
|
||||
max_length=10,
|
||||
choices=statusList
|
||||
)
|
||||
FactorType = [
|
||||
('Nasb', 'Nasb'),
|
||||
('Khadamat', 'Khadamat'),
|
||||
('Garranty', 'Garranty'),
|
||||
]
|
||||
FactorType = models.CharField(
|
||||
max_length=10,
|
||||
choices=FactorType
|
||||
)
|
||||
|
||||
class FactorIteam(models.Model):
|
||||
factor = models.ForeignKey(Factor, on_delete=models.CASCADE)
|
||||
product = models.ForeignKey(Product, on_delete=models.CASCADE)
|
||||
product_name = models.DateTimeField(auto_now_add=True)
|
||||
num = models.IntegerField()
|
||||
amount = models.IntegerField()
|
||||
|
||||
class VisitQueue(models.Model):
|
||||
customer = models.ForeignKey(Customer, on_delete=models.CASCADE)
|
||||
dateTime = models.DateTimeField()
|
||||
statusList = [
|
||||
('waiting', 'waiting'),
|
||||
('finish', 'finish'),
|
||||
('cancell', 'cancell'),
|
||||
]
|
||||
status = models.CharField(
|
||||
max_length=10,
|
||||
choices=statusList,
|
||||
default='waiting',
|
||||
)
|
||||
user = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||
GradeList = [
|
||||
('3', '3'),
|
||||
('2', '2'),
|
||||
('1', '1'),
|
||||
]
|
||||
grade = models.CharField(
|
||||
max_length=1,
|
||||
choices=GradeList,
|
||||
)
|
||||
grade_desc = models.CharField(max_length=200)
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@@ -0,0 +1,7 @@
|
||||
from django.urls import path
|
||||
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.index, name='index'),
|
||||
]
|
||||
@@ -0,0 +1,8 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
from django.http import HttpResponse
|
||||
|
||||
|
||||
def index(request):
|
||||
return HttpResponse("Hello, world. You're at the polls index.")
|
||||
Reference in new issue
Block a user