对于stark(curd)插件的使用简单介绍
一、创建表
from django.db import models from django.db import models class Department(models.Model):
"""
部门表
市场部 1000
销售 1001
"""
title = models.CharField(verbose_name='部门名称', max_length=16)
code = models.IntegerField(verbose_name='部门编号',unique=True,null=False) def __str__(self):
return self.title class UserInfo(models.Model):
"""
员工表
"""
# auth = models.OneToOneField(verbose_name='用户权限', to=rbac_model.User)
name = models.CharField(verbose_name='员工姓名', max_length=16)
username = models.CharField(verbose_name='用户名', max_length=32)
password = models.CharField(verbose_name='密码', max_length=64)
email = models.EmailField(verbose_name='邮箱', max_length=64) depart = models.ForeignKey(verbose_name='部门', to="Department",to_field="code") def __str__(self):
return self.name class Course(models.Model):
"""
课程表
如:
Linux基础
Linux架构师
Python自动化开发精英班
Python自动化开发架构师班
"""
name = models.CharField(verbose_name='课程名称', max_length=32) def __str__(self):
return self.name class School(models.Model):
"""
校区表
如:
北京海淀校区
北京昌平校区
上海虹口校区
广州白云山校区
"""
title = models.CharField(verbose_name='校区名称', max_length=32) def __str__(self):
return self.title class ClassList(models.Model):
"""
班级表
如:
Python全栈 面授班 5期 10000 2017-11-11 2018-5-11
"""
school = models.ForeignKey(verbose_name='校区', to='School')
course = models.ForeignKey(verbose_name='课程名称', to='Course') semester = models.IntegerField(verbose_name="班级(期)")
price = models.IntegerField(verbose_name="学费")
start_date = models.DateField(verbose_name="开班日期")
graduate_date = models.DateField(verbose_name="结业日期", null=True, blank=True)
memo = models.CharField(verbose_name='说明', max_length=256, blank=True, null=True)
teachers = models.ManyToManyField(verbose_name='任课老师', to='UserInfo', related_name='teach_classes')
tutor = models.ForeignKey(verbose_name='班主任', to='UserInfo', related_name='classes') def __str__(self):
return "{0}({1}期)".format(self.course.name, self.semester) class Customer(models.Model):
"""
客户表
"""
qq = models.CharField(verbose_name='qq', max_length=64, unique=True, help_text='QQ号必须唯一') name = models.CharField(verbose_name='学生姓名', max_length=16)
gender_choices = ((1, '男'), (2, '女'))
gender = models.SmallIntegerField(verbose_name='性别', choices=gender_choices) education_choices = (
(1, '重点大学'),
(2, '普通本科'),
(3, '独立院校'),
(4, '民办本科'),
(5, '大专'),
(6, '民办专科'),
(7, '高中'),
(8, '其他')
)
education = models.IntegerField(verbose_name='学历', choices=education_choices, blank=True, null=True, )
graduation_school = models.CharField(verbose_name='毕业学校', max_length=64, blank=True, null=True)
major = models.CharField(verbose_name='所学专业', max_length=64, blank=True, null=True) experience_choices = [
(1, '在校生'),
(2, '应届毕业'),
(3, '半年以内'),
(4, '半年至一年'),
(5, '一年至三年'),
(6, '三年至五年'),
(7, '五年以上'),
]
experience = models.IntegerField(verbose_name='工作经验', blank=True, null=True, choices=experience_choices)
work_status_choices = [
(1, '在职'),
(2, '无业')
]
work_status = models.IntegerField(verbose_name="职业状态", choices=work_status_choices, default=1, blank=True,
null=True)
company = models.CharField(verbose_name="目前就职公司", max_length=64, blank=True, null=True)
salary = models.CharField(verbose_name="当前薪资", max_length=64, blank=True, null=True) source_choices = [
(1, "qq群"),
(2, "内部转介绍"),
(3, "官方网站"),
(4, "百度推广"),
(5, "360推广"),
(6, "搜狗推广"),
(7, "腾讯课堂"),
(8, "广点通"),
(9, "高校宣讲"),
(10, "渠道代理"),
(11, "51cto"),
(12, "智汇推"),
(13, "网盟"),
(14, "DSP"),
(15, "SEO"),
(16, "其它"),
]
source = models.SmallIntegerField('客户来源', choices=source_choices, default=1)
referral_from = models.ForeignKey(
'self',
blank=True,
null=True,
verbose_name="转介绍自学员",
help_text="若此客户是转介绍自内部学员,请在此处选择内部学员姓名",
related_name="internal_referral"
)
course = models.ManyToManyField(verbose_name="咨询课程", to="Course") status_choices = [
(1, "已报名"),
(2, "未报名")
]
status = models.IntegerField(
verbose_name="状态",
choices=status_choices,
default=2,
help_text=u"选择客户此时的状态"
)
consultant = models.ForeignKey(verbose_name="课程顾问", to='UserInfo', related_name='consultant',limit_choices_to={'depart_id':1001})
date = models.DateField(verbose_name="咨询日期", auto_now_add=True)
last_consult_date = models.DateField(verbose_name="最后跟进日期", auto_now_add=True) def __str__(self):
return "姓名:{0},QQ:{1}".format(self.name, self.qq, ) class ConsultRecord(models.Model):
"""
客户跟进记录
"""
customer = models.ForeignKey(verbose_name="所咨询客户", to='Customer')
consultant = models.ForeignKey(verbose_name="跟踪人", to='UserInfo')
date = models.DateField(verbose_name="跟进日期", auto_now_add=True)
note = models.TextField(verbose_name="跟进内容...") class PaymentRecord(models.Model):
"""
缴费记录
"""
customer = models.ForeignKey(Customer, verbose_name="客户") class_list = models.ForeignKey(verbose_name="班级", to="ClassList", blank=True, null=True) pay_type_choices = [
(1, "订金/报名费"),
(2, "学费"),
(3, "转班"),
(4, "退学"),
(5, "退款"),
]
pay_type = models.IntegerField(verbose_name="费用类型", choices=pay_type_choices, default=1)
paid_fee = models.IntegerField(verbose_name="费用数额", default=0)
turnover = models.IntegerField(verbose_name="成交金额", blank=True, null=True)
quote = models.IntegerField(verbose_name="报价金额", blank=True, null=True)
note = models.TextField(verbose_name="备注", blank=True, null=True)
date = models.DateTimeField(verbose_name="交款日期", auto_now_add=True)
consultant = models.ForeignKey(verbose_name="负责老师", to='UserInfo', help_text="谁签的单就选谁") class Student(models.Model):
"""
学生表(已报名)
"""
customer = models.OneToOneField(verbose_name='客户信息', to='Customer') username = models.CharField(verbose_name='用户名', max_length=32)
password = models.CharField(verbose_name='密码', max_length=64)
emergency_contract = models.CharField(max_length=32, blank=True, null=True, verbose_name='紧急联系人')
class_list = models.ManyToManyField(verbose_name="已报班级", to='ClassList', blank=True) company = models.CharField(verbose_name='公司', max_length=128, blank=True, null=True)
location = models.CharField(max_length=64, verbose_name='所在区域', blank=True, null=True)
position = models.CharField(verbose_name='岗位', max_length=64, blank=True, null=True)
salary = models.IntegerField(verbose_name='薪资', blank=True, null=True)
welfare = models.CharField(verbose_name='福利', max_length=256, blank=True, null=True)
date = models.DateField(verbose_name='入职时间', help_text='格式yyyy-mm-dd', blank=True, null=True)
memo = models.CharField(verbose_name='备注', max_length=256, blank=True, null=True) def __str__(self):
return self.username class CourseRecord(models.Model):
"""
上课记录表
"""
class_obj = models.ForeignKey(verbose_name="班级", to="ClassList")
day_num = models.IntegerField(verbose_name="节次", help_text=u"此处填写第几节课或第几天课程...,必须为数字")
teacher = models.ForeignKey(verbose_name="讲师", to='UserInfo')
date = models.DateField(verbose_name="上课日期", auto_now_add=True) course_title = models.CharField(verbose_name='本节课程标题', max_length=64, blank=True, null=True)
course_memo = models.TextField(verbose_name='本节课程内容概要', blank=True, null=True)
has_homework = models.BooleanField(default=True, verbose_name="本节有作业")
homework_title = models.CharField(verbose_name='本节作业标题', max_length=64, blank=True, null=True)
homework_memo = models.TextField(verbose_name='作业描述', max_length=500, blank=True, null=True)
exam = models.TextField(verbose_name='踩分点', max_length=300, blank=True, null=True) def __str__(self):
return "{0} day{1}".format(self.class_obj, self.day_num) class StudyRecord(models.Model):
course_record = models.ForeignKey(verbose_name="第几天课程", to="CourseRecord")
student = models.ForeignKey(verbose_name="学员", to='Student')
record_choices = (('checked', "已签到"),
('vacate', "请假"),
('late', "迟到"),
('noshow', "缺勤"),
('leave_early', "早退"),
)
record = models.CharField("上课纪录", choices=record_choices, default="checked", max_length=64)
score_choices = ((100, 'A+'),
(90, 'A'),
(85, 'B+'),
(80, 'B'),
(70, 'B-'),
(60, 'C+'),
(50, 'C'),
(40, 'C-'),
(0, ' D'),
(-1, 'N/A'),
(-100, 'COPY'),
(-1000, 'FAIL'),
)
score = models.IntegerField("本节成绩", choices=score_choices, default=-1)
homework_note = models.CharField(verbose_name='作业评语', max_length=255, blank=True, null=True)
note = models.CharField(verbose_name="备注", max_length=255, blank=True, null=True) homework = models.FileField(verbose_name='作业文件', blank=True, null=True, default=None)
stu_memo = models.TextField(verbose_name='学员备注', blank=True, null=True)
date = models.DateTimeField(verbose_name='提交作业日期', auto_now_add=True) def __str__(self):
return "{0}-{1}".format(self.course_record, self.student)
models.py
二、注册表需要知道的知识点
1、部门表相关
需求:默认编辑不要了,通过字段变成可点击的,具体是哪个字段不知道,可以自定义
edit_link = ["title"]
方法:拿到字段后判断这个字段是都在edit_link里面,
- 值变成可点击的
- 反向生成url
- 获取url的参数,拼接成_listfilter
具体实现:
StarkConfig类
# =============编辑链接================
edit_link = []
def get_edit_link(self):
result = []
if self.edit_link:
result.extend(self.edit_link)
return result ChangeList类
self.edit_link = config.get_edit_link() def edit_link_tag(self,pk,text):
params = QueryDict(mutable=True)
query_str = self.request.GET.urlencode() #page=1
params[self.config._query_param_key] = query_str
#要跳转的路径http://127.0.0.1:8080/index/crm/department/1/change/?_listfilter=None%3D
return mark_safe("<a href='%s?%s'>%s</a>"%(self.config.get_change_url(pk),params.urlencode(),text)) def body_list():
#用于定制编辑列
if field_name in self.edit_link:
val = self.edit_link_tag(row.pk,val)
4、=============重写get_list_display()方法=================
实现:
# 重写get_list_display(),因为父类有这个方法,如果这里不写就会继承父类的,写了就优先执行自己的
def get_list_display(self):
result = [] result.extend(self.list_display)
result.insert(0,v1.StarkConfig.checkbox)
result.append(v1.StarkConfig.edit)
result.append(v1.StarkConfig.delete) return result
重写构造方法需要注意的:
函数和方法的区别:由于我们 val = field_name(self.config, row) ,传了一个self,
所以用第二种方式。用方式一就报错了
方式一:self.edit自己没有就找父类的,自己有就用自己的
方式二;v1.StarkConofig.edit 如果是函数自己写一个self =========写代码的时候注意加注释==========================
对类的注释
对于文件的注释
对于函数的注释
2、员工表
1、错误信息的显示
add_view
给errors加上个样式
2、自定义ModelForm
def get_model_form_class(self):
'''自定义ModelForm'''
class MyModelForm(ModelForm):
class Meta:
model = models.UserInfo
fields = "__all__"
error_messages = {
"name":{"required":"姓名不能为空"},
"username":{"required":"用户名不能为空"},
"password":{"required":"密码不能为空"},
"email":{"required":"邮箱不能为空","invalid":"邮箱格式不正确"},
"depart":{"required":"用户名不能不选",},
}
return MyModelForm
3、组合搜索的筛选条件出错了:
组合搜索的筛选条件出错了:
出的错误:当你看到明明有数据,但是却没有查到
出错原因:是由于关联的字段变了depart = models.ForeignKey(verbose_name='部门', to="Department",to_field="code")
以前关联的是pk,现在关联的是code。所以对应的值就不一样了。所以找不到了 解决办法:
在FilterOption又加了两个参数
text_func_name :组合搜素时,组合搜索时,页面上生成显示文本的函数
val_func_name :组合搜素时,页面上生成a标签的value值的函数,也就是pk
class FilterOption:
def __init__(self, field_name, is_multi=False, is_choice=False, condition=None,text_func_name=None,val_func_name=None):
self.text_func_name = text_func_name
self.val_func_name = val_func_name # ================普通按钮====================
for val in self.data: #单选
if self.option.is_choice: # ((1,'男'),(2,'女'),(1,'男'))
pk, text = str(val[0]),val[1]
else: # 外键或多对多
'''现在的做法,是由于关联的字段变了depart = models.ForeignKey(verbose_name='部门', to="Department",to_field="code")'''
text = str(self.option.text_func_name(val)) if self.option.text_func_name else str(val)
pk = str(self.option.val_func_name(val)) if self.option.val_func_name else str(val.pk)
#原来的做法 pk, text = str(val.pk), str(val)
stark.py
comb_filter = [
v1.FilterOption("depart",val_func_name=lambda x: x.code,),
]
stark.py
comb_filter = [
v1.FilterOption("depart",val_func_name=lambda x: x.code,),
] #分组搜索
3、班级管理
4、学校
5、课程
6、客户以及跟进记录
客户信息;
需求: 咨询课程
吧咨询课程以标签的形式显示
并且加样式一点击X就给删除了,
额外的增加个url
def extra_url(self):
... 客户的状态。对于未报名的学生,有个跟进记录
跟进记录:一点跳转到详细的根进记录,这个根进记录的url
加上是否显示组合搜索。。。。。
自己可以查看自己的根进记录,不可以查看别人的(自己写一个视图函数
继承父类的方法,
)
代码实现
class ConsultRecordConfig(v1.StarkConfig):
def customer_display(self,obj=None,is_header=False):
if is_header:
return "所咨询客户"
return obj.customer.name
list_display = [customer_display,"consultant","date","note"]
comb_filter = [
v1.FilterOption("customer"),
] #组合搜索默认不显示,但是却又筛选的功能 def change_views(self, request,*args, **kwargs):
customer = request.GET.get('customer')
# session中获取当前用户ID
current_login_user_id = 6
ct = models.Customer.objects.filter(consultant=current_login_user_id, id=customer).count()
if not ct:
return HttpResponse('无权访问.')
return super(ConsultRecordConfig,self).change_views(request, *args, **kwargs)
v1.site.register(models.ConsultRecord,ConsultRecordConfig) v1.py
# =============组合搜索====================
comb_filter = []
def get_comb_filter(self):
result = []
if self.comb_filter:
result.extend(self.comb_filter)
return result show_comb_filter = False
def get_show_comb_filter(self):
return self.show_comb_filter self.show_comb_filter = config.get_show_comb_filter()
在页面
{% if cl.show_comb_filter %}
<div class="list-filter">
{% for item in cl.gen_comb_filter %}
<div>
{% for col in item %}
{{ col }}
{% endfor %}
</div>
{% endfor %}
</div>
{% endif %}
图示:
三、注册表的具体使用方法
#!usr/bin/env python
# -*- coding:utf-8 -*-
from django.forms import ModelForm
from django.shortcuts import render,HttpResponse,redirect
from django.utils.safestring import mark_safe
from stark.service import v1
from crm import models
from django.conf.urls import url class DepartmentConfig(v1.StarkConfig):
list_display = ["title","code"]
edit_link = ["title"] #自定制链接,指定字段可编辑 # 重写get_list_display(),因为父类有这个方法,如果这里不写就会继承父类的,写了就优先执行自己的
def get_list_display(self):
result = [] result.extend(self.list_display)
result.insert(0,v1.StarkConfig.checkbox)
result.append(v1.StarkConfig.edit)
result.append(v1.StarkConfig.delete) return result v1.site.register(models.Department,DepartmentConfig) class UserInfoConfig(v1.StarkConfig):
edit_link = ["name"] def depart_dispaly(self,obj=None,is_header=False):
if is_header:
return "所属部门"
return obj.depart.title def get_model_form_class(self):
'''自定义ModelForm'''
class MyModelForm(ModelForm):
class Meta:
model = models.UserInfo
fields = "__all__"
error_messages = {
"name":{"required":"姓名不能为空"},
"username":{"required":"用户名不能为空"},
"password":{"required":"密码不能为空"},
"email":{"required":"邮箱不能为空","invalid":"邮箱格式不正确"},
"depart":{"required":"用户名不能不选",},
}
return MyModelForm list_display = ["name","username","email",depart_dispaly] comb_filter = [
v1.FilterOption("depart",val_func_name=lambda x: x.code,),
] #分组搜索 def delete_view(self, request,nid, *args, **kwargs):
'''重写视图函数'''
if request.method=="GET":
return render(request,"stark/delete_view.html",{"quxiao_url":self.get_list_url()})
else:
self.model_class.objects.filter(pk=nid).delete()
return redirect(self.get_list_url()) v1.site.register(models.UserInfo,UserInfoConfig) class CourseConfig(v1.StarkConfig):
list_display = ["name"]
edit_link = ["name"]
show_actions =True #显示actions def mutil_delete(self,request):
if request.method =="POST":
pk_list = request.POST.getlist("pk")
print(pk_list,"")
self.model_class.objects.filter(id__in=pk_list).delete() mutil_delete.short_desc = "批量删除"
def init_func(self):
pass
init_func.short_desc = "初始化"
actions = [mutil_delete,init_func] #actios操作 search_fields = ["name__contains"] #按照name搜索
show_search_form = True v1.site.register(models.Course,CourseConfig) class SchoolConfig(v1.StarkConfig):
list_display = ["title"]
edit_link = ["title"] v1.site.register(models.School,SchoolConfig) class ClassListConfig(v1.StarkConfig):
def teachers_display(self,obj=None,is_header=False):
if is_header:
return "任教老师"
user_list = obj.teachers.all()
html = []
for i in user_list:
html.append(i.name)
return ','.join(html) def display_graduate_date(self,obj=None,is_header=False):
if is_header:
return "结业日期"
return '' if not obj.graduate_date else obj.graduate_date def display_memo(self,obj=None,is_header=False):
if is_header:
return "说明"
return '' if not obj.memo else obj.memo def course_semester(self,obj=None,is_header=False):
if is_header:
return "课程(班级)"
return "%s(%s期)"%(obj.course,obj.semester) #列举这个班级的人数
def num(self,obj=None,is_header=False):
if is_header:
return "人数"
print(obj.student_set.all().count())
return obj.student_set.all().count()
list_display = ["school",course_semester,num,"price","start_date",display_graduate_date,display_memo,teachers_display,"tutor"]
edit_link = ["school"]
v1.site.register(models.ClassList,ClassListConfig) class CustomerConfig(v1.StarkConfig):
def display_gender(self,obj=None,is_header=False):
if is_header:
return "性别"
return obj.get_gender_display()
def display_education(self,obj=None,is_header=False):
if is_header:
return "学历"
return obj.get_education_display() def display_status(self, obj=None, is_header=False):
if is_header:
return '状态'
return obj.get_status_display()
def recode(self, obj=None, is_header=False):
if is_header:
return "跟进记录"
return mark_safe("<a href='/index/crm/consultrecord/?customer=%s'>查看跟进记录</a>" %(obj.pk,)) def display_course(self,obj=None, is_header=False):
if is_header:
return "咨询课程"
course_list = obj.course.all()
html = []
for item in course_list:
temp = "<a style='display:inline-block;padding:3px 5px;border:1px solid blue;margin:2px;' href='/index/crm/customer/%s/%s/dc/'>%s X</a>" %(obj.pk,item.pk,item.name)
html.append(temp)
return "".join(html) def extra_urls(self):
# 由于没有路径,我们可以额外的增加一个路径,重新走一个delete_course视图
app_model_name = (self.model_class._meta.app_label, self.model_class._meta.model_name)
urlpatterns =[
url(r'^(\d+)/(\d+)/dc/$', self.wrap(self.delete_course), name="%s_%s_delete" % app_model_name) ]
return urlpatterns
def delete_course(self, request,customer_id,course_id):
'''
删除当前用户感兴趣的课程
:param request:
:param customer_id:
:param course_id:
:return:
'''
customer_obj = self.model_class.objects.filter(pk=customer_id).first()
customer_obj.course.remove(course_id)
return redirect(self.get_list_url()) list_display = ["qq","name","graduation_school",display_course,display_gender,display_status,display_education,recode]
edit_link = ["name","graduation_school"]
search_fields = ["name__contains"]
show_search_form = True show_actions = True
comb_filter = [
v1.FilterOption("gender",is_choice=True),
] v1.site.register(models.Customer, CustomerConfig) class ConsultRecordConfig(v1.StarkConfig):
def customer_display(self,obj=None,is_header=False):
if is_header:
return "所咨询客户"
return obj.customer.name
list_display = [customer_display,"consultant","date","note"]
comb_filter = [
v1.FilterOption("customer"),
] #组合搜索默认不显示,但是却又筛选的功能 def change_views(self, request,*args, **kwargs):
customer = request.GET.get('customer')
# session中获取当前用户ID
current_login_user_id = 6
ct = models.Customer.objects.filter(consultant=current_login_user_id, id=customer).count()
if not ct:
return HttpResponse('无权访问.')
return super(ConsultRecordConfig,self).change_views(request, *args, **kwargs)
v1.site.register(models.ConsultRecord,ConsultRecordConfig)
v1.site.register(models.Student)
crm/stark.py
对于stark(curd)插件的使用简单介绍的更多相关文章
- angular-file-upload插件的使用简单介绍
参考博客: https://www.cnblogs.com/jarson-7426/p/5191156.html angular-file-upload 最近一段时间用了一下angular-file- ...
- unity Dotween插件的简单介绍及示例代码
unity里面做插值动画的插件有许多,比较常见的有itween.hotween.dotween.根据大家的反馈和实际体验来说,dotween插件在灵活性.稳定性.易用性上都十分突出.这里简单介绍下它的 ...
- postman插件的安装以及简单介绍
1:postman是干什么的? Postman官网上这么介绍的:“Modern software is built on APIs,Postman helps you develop APIs fas ...
- CURD插件(仿Django-admin版)
前言 如何提升自己的开发效率? 每个新项目都是自己经做过的项目(经验所致),在项目开发过程中不断总结.封装属于自己的组件, 例如:每个web项目大部分都涉及增删改查,分页显示,搜素,CRM就是这样的组 ...
- 关于JQuery简单介绍
jQuery是一个兼容多浏览器的javascript库,核心理念是写得更少,做得更多.如今,jQuery已经成为最流行的javascript库,在世界前10000个访问最多的网站中,有超过55%在使用 ...
- 【转载】JMeter学习(一)工具简单介绍
JMeter学习(一)工具简单介绍 一.JMeter 介绍 Apache JMeter是100%纯JAVA桌面应用程序,被设计为用于测试客户端/服务端结构的软件(例如web应用程序).它可以用来测试静 ...
- smarty简单介绍
smarty简单介绍 示意图如下 简单介绍smarty.class.php类的大体内容,如下: <?php class Smarty //此类就是libs中的Smarty.class.php类 ...
- UploadifyAPI-上传插件属性和方法介绍
上一篇文章简单的介绍了Uploadify上传插件的使用.但是对于常用的属性和方法并没有说明.授人以鱼不如授人以渔,我决定将常用的属性列举出来,供大伙参考参考. Uploadify属 ...
- Epplus 使用的简单介绍
操作Excel的主要有以下类库: MyXls(http://sourceforge.net/projects/myxls/) Koogra(http://sourceforge.net/project ...
随机推荐
- asp.net core处理中文的指南
参考资料:https://docs.microsoft.com/en-us/aspnet/core/security/cross-site-scripting Customizing the Enco ...
- mongodb系列~配置文件的优化与处理
一 简介:讲讲如何优化mongo配置文件二 常规参数 port= //端口 fork=true//守护进程方式启动mongo logpath=shard.log //mongo ...
- C++中,有哪4种与类型转换相关的关键字?各有什么特点?应该在什么场合下使用?
转:https://www.cnblogs.com/mjiang2017/p/9358032.html C++中,四个与类型转换相关的关键字:static_cast.const_cast.reinte ...
- android checkBox选中与取消
checkView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO ...
- C++中的static关键字总结
C++的static有两种用法:面向过程程序设计中的static和面向对象程序设计中的static.前者应用于普通变量和函数,不涉及类:后者主要说明static在类中的作用. 1.面向过程设计中的st ...
- python中// 和/有什么区别
python中// 和/有什么区别 通常C/C++中,"/ " 算术运算符的计算结果是根据参与运算的两边的数据决定的,比如: 6 / 3 = 2 ; 6,3都是整数,那么结果也就是 ...
- http://nancyfx.org + ASPNETCORE
商务产品servicestack: https://servicestack.net/ http://nancyfx.org + ASPNETCORE http://nancyfx.org ...
- python3+requests库框架设计06-测试脚本
在项目下新建TestCase文件夹,然后新建.py文件在文件中写关于接口具体的测试脚本,一般我喜欢按照模块来分,一个模块一个.py文件,建议以test开头命名文件 把配置文件改成这样 url:http ...
- boost.log在项目中应用
//头文件#pragma once #include <string> #include <boost/log/trivial.hpp> using std::string; ...
- System.Data.SqlClient.SqlException: 数据类型 text 和 varchar 在 equal to 运算符中不兼容。
一.引起的源头 环境:vs2015,sqlserver2008 相关程序包:ef6 定义了一个实体article public class Article { public string Data{g ...