在我的表中:
我的折扣类型是 DECIMAL:
我在表中的数据:
但是为什么当我在 API 中获取数据时,会得到字符串?
我使用 Django/Django-Rest-Framework 作为后端。
编辑
belong_product:"?????"
ctime:"2018-04-11T15:41:15.744959+08:00"
desc: ""
discount:"0.005"
id : 1
is_enable :false
max_count:5
min_count:0
name:"???????"
uptime:"2018-04-11T15:41:15.745226+08:00"
Run Code Online (Sandbox Code Playgroud)
我的 ListAPI 视图:
class DiscountItemByUserOwnCountListAPIView(ListAPIView):
serializer_class = DiscountItemByUserOwnCountSerializer
permission_classes = [IsSuperAdmin]
pagination_class = CommonPagination
def get_queryset(self):
return DiscountItemByUserOwnCount.objects.all()
Run Code Online (Sandbox Code Playgroud)
我的型号:
class DiscountItemByUserOwnCount(models.Model):
name = models.CharField(max_length=16, help_text="??")
desc = models.CharField(max_length=512, null=True, blank=True, help_text="??")
min_count = models.IntegerField(help_text="???????")
max_count = models.IntegerField(help_text="???????") # ??~?? ????
discount = models.DecimalField(max_digits=4, decimal_places=3, default=0.000, unique=True,
help_text="??") # ??: 0.001
belong_product = models.CharField(max_length=16, help_text="?????DISCOUNT_PRODUCT_TYPE?????")
is_enable …Run Code Online (Sandbox Code Playgroud) 我有套接字服务器和套接字客户端两个端程序:
服务器:
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
# Author:sele
import socket
HOST = '127.0.0.1'
PORT = 65432
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind((HOST, PORT))
s.listen()
conn, addr = s.accept()
with conn:
print('Connected by', addr)
if addr and addr[0] != '127.0.0.44':
conn.sendall(b'ip error') # there I want to cut off the socket connection.
else:
while True:
data = conn.recv(1024)
if not data:
break
conn.sendall(data)
Run Code Online (Sandbox Code Playgroud)
客户端:
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
# Author:lele
import socket
HOST = '127.0.0.1'
PORT = 65432
with …Run Code Online (Sandbox Code Playgroud) 当我使用IntelliJ IDEA打开Java项目时,项目名称中显示一个蓝色正方形:
那是什么意思 并且我发现我无法编辑该项目的文件,并且还显示了File is read-only。
如果项目是只读的,如何使它成为可读写的?
我的Intellij IDEA版本是2019.1.3。
我的项目从.jar软件包中解压缩。
在我的 nuxt.js bootstrap-vue 项目中:
我按照github使用引导程序图标: 链接
我的代码:
<b-icon variant="success" icon="arrow-up"></b-icon>
<b-icon variant="success" icon="alert-triangle"></b-icon>
<b-icon icon="alert-circle-fill" variant="success"></b-icon>
<h2 class="group_title">Anime Wallpapers</h2>
...
<script>
import { BIcon, BIconArrowUp } from 'bootstrap-vue'
export default{
data(){
return {
msg: 'hello vue'
}
},
components: {
BIcon
}
}
</script>
Run Code Online (Sandbox Code Playgroud)
但没有显示出来: