feat: 初始化项目

This commit is contained in:
Czw996 2021-11-04 23:49:56 +08:00
parent 3cfe55ac01
commit ed60c71c6d
101 changed files with 622 additions and 55 deletions

7
apps/data/filters.py Normal file
View file

@ -0,0 +1,7 @@
from django_filters.rest_framework import FilterSet
from django_filters.filters import *
__all__ = [
]

View file

@ -1,3 +1,6 @@
from django.db import models
from extensions.models import *
# Create your models here.
__all__ = [
]

6
apps/data/permissions.py Normal file
View file

@ -0,0 +1,6 @@
from extensions.permissions import InterfacePermission
__all__ = [
]

6
apps/data/schemas.py Normal file
View file

@ -0,0 +1,6 @@
from extensions.serializers import *
__all__ = [
]

7
apps/data/serializers.py Normal file
View file

@ -0,0 +1,7 @@
from extensions.serializers import *
from extensions.exceptions import *
__all__ = [
]

5
apps/data/urls.py Normal file
View file

@ -0,0 +1,5 @@
from extensions.routers import *
router = BaseRouter()
urlpatterns = router.urls

View file

@ -1,3 +1,8 @@
from django.shortcuts import render
from extensions.permissions import *
from extensions.exceptions import *
from extensions.viewsets import *
# Create your views here.
__all__ = [
]

7
apps/finance/filters.py Normal file
View file

@ -0,0 +1,7 @@
from django_filters.rest_framework import FilterSet
from django_filters.filters import *
__all__ = [
]

View file

@ -1,3 +1,6 @@
from django.db import models
from extensions.models import *
# Create your models here.
__all__ = [
]

View file

@ -0,0 +1,6 @@
from extensions.permissions import InterfacePermission
__all__ = [
]

6
apps/finance/schemas.py Normal file
View file

@ -0,0 +1,6 @@
from extensions.serializers import *
__all__ = [
]

View file

@ -0,0 +1,7 @@
from extensions.serializers import *
from extensions.exceptions import *
__all__ = [
]

5
apps/finance/urls.py Normal file
View file

@ -0,0 +1,5 @@
from extensions.routers import *
router = BaseRouter()
urlpatterns = router.urls

View file

@ -1,3 +1,8 @@
from django.shortcuts import render
from extensions.permissions import *
from extensions.exceptions import *
from extensions.viewsets import *
# Create your views here.
__all__ = [
]

7
apps/flow/filters.py Normal file
View file

@ -0,0 +1,7 @@
from django_filters.rest_framework import FilterSet
from django_filters.filters import *
__all__ = [
]

View file

@ -1,3 +1,6 @@
from django.db import models
from extensions.models import *
# Create your models here.
__all__ = [
]

6
apps/flow/permissions.py Normal file
View file

@ -0,0 +1,6 @@
from extensions.permissions import InterfacePermission
__all__ = [
]

6
apps/flow/schemas.py Normal file
View file

@ -0,0 +1,6 @@
from extensions.serializers import *
__all__ = [
]

7
apps/flow/serializers.py Normal file
View file

@ -0,0 +1,7 @@
from extensions.serializers import *
from extensions.exceptions import *
__all__ = [
]

5
apps/flow/urls.py Normal file
View file

@ -0,0 +1,5 @@
from extensions.routers import *
router = BaseRouter()
urlpatterns = router.urls

View file

@ -1,3 +1,8 @@
from django.shortcuts import render
from extensions.permissions import *
from extensions.exceptions import *
from extensions.viewsets import *
# Create your views here.
__all__ = [
]

7
apps/goods/filters.py Normal file
View file

@ -0,0 +1,7 @@
from django_filters.rest_framework import FilterSet
from django_filters.filters import *
__all__ = [
]

View file

@ -1,3 +1,6 @@
from django.db import models
from extensions.models import *
# Create your models here.
__all__ = [
]

View file

@ -0,0 +1,6 @@
from extensions.permissions import InterfacePermission
__all__ = [
]

6
apps/goods/schemas.py Normal file
View file

@ -0,0 +1,6 @@
from extensions.serializers import *
__all__ = [
]

View file

@ -0,0 +1,7 @@
from extensions.serializers import *
from extensions.exceptions import *
__all__ = [
]

5
apps/goods/urls.py Normal file
View file

@ -0,0 +1,5 @@
from extensions.routers import *
router = BaseRouter()
urlpatterns = router.urls

View file

@ -1,3 +1,8 @@
from django.shortcuts import render
from extensions.permissions import *
from extensions.exceptions import *
from extensions.viewsets import *
# Create your views here.
__all__ = [
]

7
apps/option/filters.py Normal file
View file

@ -0,0 +1,7 @@
from django_filters.rest_framework import FilterSet
from django_filters.filters import *
__all__ = [
]

View file

@ -1,3 +1,6 @@
from django.db import models
from extensions.models import *
# Create your models here.
__all__ = [
]

View file

@ -0,0 +1,6 @@
from extensions.permissions import InterfacePermission
__all__ = [
]

6
apps/option/schemas.py Normal file
View file

@ -0,0 +1,6 @@
from extensions.serializers import *
__all__ = [
]

View file

@ -0,0 +1,7 @@
from extensions.serializers import *
from extensions.exceptions import *
__all__ = [
]

5
apps/option/urls.py Normal file
View file

@ -0,0 +1,5 @@
from extensions.routers import *
router = BaseRouter()
urlpatterns = router.urls

View file

@ -1,3 +1,8 @@
from django.shortcuts import render
from extensions.permissions import *
from extensions.exceptions import *
from extensions.viewsets import *
# Create your views here.
__all__ = [
]

7
apps/purchase/filters.py Normal file
View file

@ -0,0 +1,7 @@
from django_filters.rest_framework import FilterSet
from django_filters.filters import *
__all__ = [
]

View file

@ -1,3 +1,6 @@
from django.db import models
from extensions.models import *
# Create your models here.
__all__ = [
]

View file

@ -0,0 +1,6 @@
from extensions.permissions import InterfacePermission
__all__ = [
]

6
apps/purchase/schemas.py Normal file
View file

@ -0,0 +1,6 @@
from extensions.serializers import *
__all__ = [
]

View file

@ -0,0 +1,7 @@
from extensions.serializers import *
from extensions.exceptions import *
__all__ = [
]

5
apps/purchase/urls.py Normal file
View file

@ -0,0 +1,5 @@
from extensions.routers import *
router = BaseRouter()
urlpatterns = router.urls

View file

@ -1,3 +1,8 @@
from django.shortcuts import render
from extensions.permissions import *
from extensions.exceptions import *
from extensions.viewsets import *
# Create your views here.
__all__ = [
]

7
apps/sales/filters.py Normal file
View file

@ -0,0 +1,7 @@
from django_filters.rest_framework import FilterSet
from django_filters.filters import *
__all__ = [
]

View file

@ -1,3 +1,6 @@
from django.db import models
from extensions.models import *
# Create your models here.
__all__ = [
]

View file

@ -0,0 +1,6 @@
from extensions.permissions import InterfacePermission
__all__ = [
]

6
apps/sales/schemas.py Normal file
View file

@ -0,0 +1,6 @@
from extensions.serializers import *
__all__ = [
]

View file

@ -0,0 +1,7 @@
from extensions.serializers import *
from extensions.exceptions import *
__all__ = [
]

5
apps/sales/urls.py Normal file
View file

@ -0,0 +1,5 @@
from extensions.routers import *
router = BaseRouter()
urlpatterns = router.urls

View file

@ -1,3 +1,8 @@
from django.shortcuts import render
from extensions.permissions import *
from extensions.exceptions import *
from extensions.viewsets import *
# Create your views here.
__all__ = [
]

View file

@ -0,0 +1,7 @@
from django_filters.rest_framework import FilterSet
from django_filters.filters import *
__all__ = [
]

View file

@ -1,3 +1,6 @@
from django.db import models
from extensions.models import *
# Create your models here.
__all__ = [
]

View file

@ -0,0 +1,6 @@
from extensions.permissions import InterfacePermission
__all__ = [
]

View file

@ -0,0 +1,6 @@
from extensions.serializers import *
__all__ = [
]

View file

@ -0,0 +1,7 @@
from extensions.serializers import *
from extensions.exceptions import *
__all__ = [
]

5
apps/statistic/urls.py Normal file
View file

@ -0,0 +1,5 @@
from extensions.routers import *
router = BaseRouter()
urlpatterns = router.urls

View file

@ -1,3 +1,8 @@
from django.shortcuts import render
from extensions.permissions import *
from extensions.exceptions import *
from extensions.viewsets import *
# Create your views here.
__all__ = [
]

View file

@ -0,0 +1,7 @@
from django_filters.rest_framework import FilterSet
from django_filters.filters import *
__all__ = [
]

View file

@ -1,3 +1,6 @@
from django.db import models
from extensions.models import *
# Create your models here.
__all__ = [
]

View file

@ -0,0 +1,6 @@
from extensions.permissions import InterfacePermission
__all__ = [
]

View file

@ -0,0 +1,6 @@
from extensions.serializers import *
__all__ = [
]

View file

@ -0,0 +1,7 @@
from extensions.serializers import *
from extensions.exceptions import *
__all__ = [
]

5
apps/stock_check/urls.py Normal file
View file

@ -0,0 +1,5 @@
from extensions.routers import *
router = BaseRouter()
urlpatterns = router.urls

View file

@ -1,3 +1,8 @@
from django.shortcuts import render
from extensions.permissions import *
from extensions.exceptions import *
from extensions.viewsets import *
# Create your views here.
__all__ = [
]

7
apps/stock_in/filters.py Normal file
View file

@ -0,0 +1,7 @@
from django_filters.rest_framework import FilterSet
from django_filters.filters import *
__all__ = [
]

View file

@ -1,3 +1,6 @@
from django.db import models
from extensions.models import *
# Create your models here.
__all__ = [
]

View file

@ -0,0 +1,6 @@
from extensions.permissions import InterfacePermission
__all__ = [
]

6
apps/stock_in/schemas.py Normal file
View file

@ -0,0 +1,6 @@
from extensions.serializers import *
__all__ = [
]

View file

@ -0,0 +1,7 @@
from extensions.serializers import *
from extensions.exceptions import *
__all__ = [
]

5
apps/stock_in/urls.py Normal file
View file

@ -0,0 +1,5 @@
from extensions.routers import *
router = BaseRouter()
urlpatterns = router.urls

View file

@ -1,3 +1,8 @@
from django.shortcuts import render
from extensions.permissions import *
from extensions.exceptions import *
from extensions.viewsets import *
# Create your views here.
__all__ = [
]

View file

@ -0,0 +1,7 @@
from django_filters.rest_framework import FilterSet
from django_filters.filters import *
__all__ = [
]

View file

@ -1,3 +1,6 @@
from django.db import models
from extensions.models import *
# Create your models here.
__all__ = [
]

View file

@ -0,0 +1,6 @@
from extensions.permissions import InterfacePermission
__all__ = [
]

View file

@ -0,0 +1,6 @@
from extensions.serializers import *
__all__ = [
]

View file

@ -0,0 +1,7 @@
from extensions.serializers import *
from extensions.exceptions import *
__all__ = [
]

5
apps/stock_out/urls.py Normal file
View file

@ -0,0 +1,5 @@
from extensions.routers import *
router = BaseRouter()
urlpatterns = router.urls

View file

@ -1,3 +1,8 @@
from django.shortcuts import render
from extensions.permissions import *
from extensions.exceptions import *
from extensions.viewsets import *
# Create your views here.
__all__ = [
]

View file

@ -0,0 +1,7 @@
from django_filters.rest_framework import FilterSet
from django_filters.filters import *
__all__ = [
]

View file

@ -1,3 +1,6 @@
from django.db import models
from extensions.models import *
# Create your models here.
__all__ = [
]

View file

@ -0,0 +1,6 @@
from extensions.permissions import InterfacePermission
__all__ = [
]

View file

@ -0,0 +1,6 @@
from extensions.serializers import *
__all__ = [
]

View file

@ -0,0 +1,7 @@
from extensions.serializers import *
from extensions.exceptions import *
__all__ = [
]

View file

@ -0,0 +1,5 @@
from extensions.routers import *
router = BaseRouter()
urlpatterns = router.urls

View file

@ -1,3 +1,8 @@
from django.shortcuts import render
from extensions.permissions import *
from extensions.exceptions import *
from extensions.viewsets import *
# Create your views here.
__all__ = [
]

View file

@ -3,4 +3,4 @@ from django.apps import AppConfig
class SystemConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'system'
name = 'apps.system'

7
apps/system/filters.py Normal file
View file

@ -0,0 +1,7 @@
from django_filters.rest_framework import FilterSet
from django_filters.filters import *
__all__ = [
]

View file

@ -23,7 +23,7 @@ class Permission(Model):
code = CharField(max_length=64, verbose_name='权限代码')
class Role(BaseModel):
class Role(Model, ModelMixin):
"""角色"""
name = CharField(max_length=64, verbose_name='名称')
@ -35,7 +35,7 @@ class Role(BaseModel):
unique_together = [('name', 'team')]
class User(BaseModel):
class User(Model, ModelMixin):
"""用户"""
username = CharField(max_length=32, verbose_name='用户名')

View file

@ -0,0 +1,6 @@
from extensions.permissions import InterfacePermission
__all__ = [
]

6
apps/system/schemas.py Normal file
View file

@ -0,0 +1,6 @@
from extensions.serializers import *
__all__ = [
]

View file

@ -0,0 +1,7 @@
from extensions.serializers import *
from extensions.exceptions import *
__all__ = [
]

5
apps/system/urls.py Normal file
View file

@ -0,0 +1,5 @@
from extensions.routers import *
router = BaseRouter()
urlpatterns = router.urls

View file

@ -1,3 +1,8 @@
from django.shortcuts import render
from extensions.permissions import *
from extensions.exceptions import *
from extensions.viewsets import *
# Create your views here.
__all__ = [
]

View file

@ -8,7 +8,7 @@ from django.db.models.functions import Coalesce
from django.db import transaction, connection
class BaseModel(Model):
class ModelMixin():
def validate(self):
"""验证"""
@ -23,7 +23,7 @@ class AmountField(DecimalField):
__all__ = [
'Model', 'BaseModel', 'IntegerChoices', 'TextChoices',
'Model', 'ModelMixin', 'IntegerChoices', 'TextChoices',
'CASCADE', 'SET_NULL', 'SET_DEFAULT', 'PROTECT',
'OneToOneField', 'ForeignKey', 'ManyToManyField',
'BooleanField', 'IntegerField', 'FloatField', 'DecimalField', 'AmountField',

View file

@ -46,6 +46,18 @@ INSTALLED_APPS = [
'debug_toolbar',
'apps.system',
'apps.data',
'apps.goods',
'apps.purchase',
'apps.sales',
'apps.stock_in',
'apps.stock_out',
'apps.stock_check',
'apps.stock_transfer',
'apps.flow',
'apps.finance',
'apps.statistic',
'apps.option',
]
MIDDLEWARE = [

View file

@ -32,4 +32,16 @@ urlpatterns = [
*static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT),
path('api/', include('apps.system.urls')),
path('api/', include('apps.data.urls')),
path('api/', include('apps.goods.urls')),
path('api/', include('apps.purchase.urls')),
path('api/', include('apps.sales.urls')),
path('api/', include('apps.stock_in.urls')),
path('api/', include('apps.stock_out.urls')),
path('api/', include('apps.stock_check.urls')),
path('api/', include('apps.stock_transfer.urls')),
path('api/', include('apps.flow.urls')),
path('api/', include('apps.finance.urls')),
path('api/', include('apps.statistic.urls')),
path('api/', include('apps.option.urls')),
]

View file

@ -0,0 +1,7 @@
from django_filters.rest_framework import FilterSet
from django_filters.filters import *
__all__ = [
]

View file

@ -0,0 +1,6 @@
from extensions.permissions import InterfacePermission
__all__ = [
]

View file

@ -0,0 +1,6 @@
from extensions.serializers import *
__all__ = [
]

View file

@ -0,0 +1,7 @@
from extensions.serializers import *
from extensions.exceptions import *
__all__ = [
]

View file

@ -0,0 +1,5 @@
from extensions.routers import *
router = BaseRouter()
urlpatterns = router.urls

Some files were not shown because too many files have changed in this diff Show more