Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified LenovoShop/LenovoShop/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file modified LenovoShop/LenovoShop/__pycache__/settings.cpython-39.pyc
Binary file not shown.
Binary file modified LenovoShop/LenovoShop/__pycache__/urls.cpython-39.pyc
Binary file not shown.
Binary file modified LenovoShop/LenovoShop/__pycache__/wsgi.cpython-39.pyc
Binary file not shown.
14 changes: 10 additions & 4 deletions LenovoShop/LenovoShop/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'login',
'comment',
'purchase',
'register',
'order',
'shopping',
'store',
'user',
'distribu',
]

MIDDLEWARE = [
Expand All @@ -58,7 +60,7 @@
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand Down Expand Up @@ -131,3 +133,7 @@
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

# 设置media路径
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
11 changes: 9 additions & 2 deletions LenovoShop/LenovoShop/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@
"""
from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url, include
from django.contrib.staticfiles.urls import static

urlpatterns = [
path('admin/', admin.site.urls),
path('login/', include('login.urls')),
path('user/',include('user.urls')),
path('admin/', include('shopAdmin.urls')),
path('order/',include('order.urls')),
path('store/',include('store.urls')),
path('shopping/',include('shopping.urls')),

]

Binary file modified LenovoShop/comment/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file modified LenovoShop/comment/__pycache__/admin.cpython-39.pyc
Binary file not shown.
Binary file modified LenovoShop/comment/__pycache__/models.cpython-39.pyc
Binary file not shown.
24 changes: 0 additions & 24 deletions LenovoShop/comment/migrations/0001_initial.py

This file was deleted.

Binary file not shown.
6 changes: 4 additions & 2 deletions LenovoShop/comment/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from django.db import models
from ..login.models import User
from ..purchase.models import Item
from user.models import UserModel as User


# Create your models here.
Expand All @@ -15,3 +14,6 @@ class Comment(models.Model):
comment_time = models.DateTimeField()
# 上一条回复,类型也是评论,这时需要使用继承
# latest_reply =

# 评论内容
comment_content = models.TextField()
Binary file modified LenovoShop/db.sqlite3
Binary file not shown.
File renamed without changes.
4 changes: 2 additions & 2 deletions LenovoShop/login/apps.py → LenovoShop/distribu/apps.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.apps import AppConfig


class LoginConfig(AppConfig):
class DistribuConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'login'
name = 'distribu'
3 changes: 3 additions & 0 deletions LenovoShop/distribu/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
File renamed without changes.
3 changes: 3 additions & 0 deletions LenovoShop/distribu/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.
Binary file removed LenovoShop/login/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file removed LenovoShop/login/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file removed LenovoShop/login/__pycache__/admin.cpython-39.pyc
Binary file not shown.
Binary file removed LenovoShop/login/__pycache__/apps.cpython-38.pyc
Binary file not shown.
Binary file removed LenovoShop/login/__pycache__/apps.cpython-39.pyc
Binary file not shown.
Binary file removed LenovoShop/login/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file removed LenovoShop/login/__pycache__/models.cpython-39.pyc
Binary file not shown.
Binary file removed LenovoShop/login/__pycache__/urls.cpython-39.pyc
Binary file not shown.
Binary file removed LenovoShop/login/__pycache__/views.cpython-39.pyc
Binary file not shown.
23 changes: 0 additions & 23 deletions LenovoShop/login/migrations/0001_initial.py

This file was deleted.

18 changes: 0 additions & 18 deletions LenovoShop/login/migrations/0002_alter_user_user_email.py

This file was deleted.

23 changes: 0 additions & 23 deletions LenovoShop/login/migrations/0003_auto_20211210_1131.py

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
16 changes: 0 additions & 16 deletions LenovoShop/login/models.py

This file was deleted.

10 changes: 0 additions & 10 deletions LenovoShop/login/urls.py

This file was deleted.

115 changes: 0 additions & 115 deletions LenovoShop/login/views.py

This file was deleted.

File renamed without changes.
Binary file added LenovoShop/order/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file added LenovoShop/order/__pycache__/admin.cpython-39.pyc
Binary file not shown.
Binary file not shown.
Binary file added LenovoShop/order/__pycache__/urls.cpython-39.pyc
Binary file not shown.
Binary file not shown.
File renamed without changes.
5 changes: 5 additions & 0 deletions LenovoShop/order/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class OrderConfig(AppConfig):
name = 'order'
42 changes: 42 additions & 0 deletions LenovoShop/order/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from django.db import models


from user.models import UserTicketModel
from store.models import GoodsValue
from user.models import UserModel
# Create your models here.

# 创建订单表模型
class OrderModel(models.Model):
o_id = models.CharField(max_length=20, primary_key=True) # 订单id
o_user = models.ForeignKey(UserModel,on_delete=models.CASCADE) # 关联用户
o_date = models.DateTimeField(auto_now=True) # 购买日期
o_pay = models.BooleanField(default=False) # 付款属性
o_total = models.DecimalField(max_digits=6, decimal_places=2) # 总价
o_address = models.CharField(max_length=150) # 收货地址

class Meta:
db_table = "order"



# 创建订单详情表模型
class OrderDetailModel(models.Model):
goods = models.ForeignKey(GoodsValue,on_delete=models.CASCADE) # 关联商品
order = models.ForeignKey(OrderModel,on_delete=models.CASCADE) # 关联商品
price = models.DecimalField(max_digits=5, decimal_places=2) # 总价
count = models.IntegerField() # 数量
isTrue = models.BooleanField(default=False) # 统计销量是否统计进去

class Meta:
db_table = "order_detail"


# 创建销量统计表模型
class Sales(models.Model):
goods = models.ForeignKey(GoodsValue,on_delete=models.CASCADE) # 管理商品名称
count = models.IntegerField() # 销量
total_price = models.DecimalField(max_digits=5, decimal_places=2) # 销售额

class Meta:
db_table = "sales"
File renamed without changes.
15 changes: 15 additions & 0 deletions LenovoShop/order/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from django.conf.urls import url

from order import views


urlpatterns = [
# 提交订单
url(r'^place_order/', views.place_order, name='place_order'),
# 用户中心 - 用户信息页
url(r'^user_center_info/', views.user_center_info, name='user_center_info'),
# 用户中心 - 用户订单页
url(r'^user_center_order/', views.user_center_order, name='user_center_order'),
# 用户中心 - 用户收货地址页
url(r'^user_center_site/', views.user_center_site, name='user_center_site'),
]
Loading