publish

day54总结

社会主义新天地 提交于 2019-12-06 08:08:46
目录 聚合查询 聚合函数 分组查询 F查询与Q查询 F查询 Q查询 常用字段及参数 自定义Char字段 图书管理系统 BMS(Book Manage System)首页搭建 新增图书页面 图书编辑页面 删除图书页面 orm中的事务操作 四大特性---ACID 数据库三大范式 作用 django中如何开启事务 聚合查询 聚合函数 聚合函数一般用在分组之后, 没有分组默认整体就是一组 1.关键字 aggregate, 2.导入模块: from django.models import Max, Min, Sum, Avg, Count 小提示: 与数据库相关的功能, 基本都在django.db.models或django.db中 from django.db.models import Max, Min, Sum, Avg, Count # 求所有书的最高价格 res = models.Book.objects.aggregate(max_price=Max('price')) print(res) # {'max_price': Decimal('999.00')} # 一起使用 res = models.Book.objects.aggregate(Min('price'), Sum('price'), Count('price'), Avg('price')) print(res

day53总结

試著忘記壹切 提交于 2019-12-06 08:05:30
目录 如何配置测试脚本 单表操作补充 创建表 新增表中的数据 查询表中的数据 修改表中的数据 删除数据 QuerySet必知必会13条 神奇的双下划綫查询 多表查询数据准备 一对多增删改查 增 改 删 多对多增删改查 增 改 删 清空 跨表查询 正反向查询 基于对象的跨表查询 正向查询 反向查询 基于双下划线的跨表查询 正向查询 反向查询 如何配置测试脚本 当向单独测试django中某一个py文件, 需要手动配置测试脚本 在应用名文件夹下的test文件中书写5行代码 一定要等待测试脚本搭建完毕之后 才能导入文件进行测试 import os if __name__ == '__main__': os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django01.settings") import django django.setup() 单表操作补充 创建表 数据库只能手动创建 class TestBooks(models.Model): title = models.CharField(max_length=32) price = models.DecimalField(max_digits=8, decimal_places=2) publish_date = models.DateField() def __str__(self

Is there a way to include an assembly referenced using Unity when using publish website?

这一生的挚爱 提交于 2019-12-06 07:34:37
问题 I'm a using the repository pattern and Unity to manage the dependency to my concrete repository objects. In itself this is not an issue however I am running into a problem when using publish website in both VS and the TFS build process. I believe the problem is being caused by the fact that although the project which contains the concrete repository objects is referenced in my application, the classes that it contains are never used directly. This is because I am using Unity to create

day 53小结

守給你的承諾、 提交于 2019-12-06 07:11:30
目录 如何配置测试脚本 给表创建数据的两种方式 查询 一 二 删除 (一般不使用) 一 利用 queryset 方法 delete() 二 对象方法 Django终端打印SQL语句 必知必会13条 1 all() 查询所有 2 filter() 筛选 相当于你原生 sql 语句里面的 where关键字 3 get() 筛选 获取的是数据对象本身 条件不存在直接报错 并且只能查询一个 4 first() 取 queryset 中第一个数据对象 数据对象 5 last() 取 queryset 中最后一个数据对象 数据对象 6 count() 统计数据的个数 数字 7 values() 获取数据对象中指定的字段值 可以多个 queryset 列表套字典 8 values_list() 获取数据对象中指定字段的值 可以有多个 queryset 列表套元组 9 order_by() 按照指定的字段排序 10 reverse() 颠倒顺序 前提是颠倒的对象必须有顺序(前提排序之后才能颠倒顺序) 11 exclude() 排除什么什么之外 queryset 对象 12 exists() 判断查询结果是否有值 返回一个布尔值 13 distinct() 对查询结果进行去重操作 去重的前提:数据必须是完全相同的情况下 才能去重 神奇的双下划线查询 大于 __gt 小于 __lt 大于等于 _

django之ORM的查询优化,Ajax

风流意气都作罢 提交于 2019-12-06 06:33:48
目录 ORM查询优化 only与defer select_related与prefetch_related查询优化 choices参数  MTV与MVC模型 Ajax简介 AJAX常见应用情景 AJAX的优缺点 Ajax基本语法结构 Ajax基本示例1(实现与服务器端数据交换) 前后端传输数据编码格式 form表单往后端发post请求的编码格式及发送文件 ajax往后端发post请求的编码格式及发送文件 序列化 Ajax结合sweetalert实现删除按钮的提示功能 自定义分页器 多对多的三种建立方式 ORM查询优化 only与defer res = models.Book.objects.all().values('title') print(res) # <QuerySet [{'title': '三国演义'}, {'title': '红楼梦'}, {'title': '水浒传'}, {'title': '天龙八部'}]> for i in res: print(i,type(i)) # <class 'dict'> print(i.title) # AttributeError: 'dict' object has no attribute 'title' ,for循环出来就是第一个普通的字典,字典没有点取值的方式 only :查询only后括号内指定的字段,查询一次

Android Facebook wall post - publish_action permission not authorized

别说谁变了你拦得住时间么 提交于 2019-12-06 05:28:00
I am currently developing an application where I just need to post the message on Facebook user's timeline saying that " I am currently using X application and you can download it from ". Now for this I need the Facebook permission which is "publish_actions". When I try to open an authorize dialog with this permission, I am having the following error, so now user is not even asked for the publish_actions permission, and so I am not being able to post any message on the user's wall. I am right now using the application id of the test app that I have created of my real application registered on

Manual XBAP publishing

烈酒焚心 提交于 2019-12-06 05:10:41
I found a method to manually publish a regular WPF Application, but i need the same instructions for a WPF Browser app instead. Here is the regular WPF App howto: http://msdn.microsoft.com/en-us/library/xc3tc5xx(VS.80).aspx . If anyone knows what changes I need to make to my mage commands to make it work for XBAP please let me know. Thanks. I had to alter the name of the default "Application Files" folder for one of our customers who doesn't like spaces in file or folder names and this meant re-signing the xbap after the publish. Here's the msbuild script I use to automate the process: <Target

Facebook Connect iPhone custom publish stream

青春壹個敷衍的年華 提交于 2019-12-06 04:06:00
问题 I just downloaded the Facebook SDK for iOS because I need to be able to publish custom streams to user's Facebook feeds. The sample app has a method called publishStream:(id)sender that appears to set up a custom description for the Publish Stream dialog, but when my dialog comes up all I see is an empty dialog to start typing in. The code in the sample app is this: `SBJSON *jsonWriter = [[SBJSON new] autorelease]; NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary

Django模型层—ORM

和自甴很熟 提交于 2019-12-06 03:31:52
目录 一、模型层(models) 1-1. 常用的字段类型 1-2. 字段参数 1-3. 自定义char字段 1-4. 外键关系 二、Django中测试脚本的使用 三、单表操作 3-1. 添加记录 3-2. 删除记录 3-3. 修改记录 3-4. 单表查询-必知必会13条 3-5. orm注意事项 3-6. 单表查询-双下划线 四、多表操作 4-1. 一对多 4-2. 多对多 1.添加数据 add() 2.删除数据 remove() 3.清空数据 clear() 4.修改数据 set() 4-3. 基于对象的跨表查询 1.一对一 查询数据 2.一对多 3.多对多 4-4. 基于双下划线查询 1.一对一 2.一对多 3.多对多 4.联表操作 五、聚合查询 六、分组查询 七、F查询 八、Q查询 Q对象高级用法 九、ORM中的事务操作 9-1. 什么是事务 9-2. 事务的特性(ACID) 十, 数据库三大范式 数据库设计范式 理解三大范式 一、模型层(models) Django提供了一个orm(关系映射模型)系统,模型包含了一些字段信息以及查询方法 1-1. 常用的字段类型 AutoField 当model中如果没有自增列,则会自动创建一个列名为id的列,int 自增列,必须填入参数primary_key=True CharField 字符类型 , 必须提供max_length参数,

.NET Core 发布(dotnet publish)

拜拜、爱过 提交于 2019-12-06 03:29:55
目录 一、需求 二、方法 三、参考 一、需求 使用.net core 3.0建的项目,一般情况下,每次想发布都要打开vs,然后点击发布,选择配置; 如果想用cmd命令行发布,应该怎么写呢? 二、方法 项目目录如下: 1、打开cmd窗口,cd到当前目录,执行如下语句: dotnet publish -c Release -r win-x64 -o ./publish/psma --self-contained true 项目发布成功: 效果如同使用vs发布: 2、创建一个用于发布的bat批处理文件 bat文件中写入如下命令: cd /d %~dp0 dotnet publish -c Release -r linux-x64 -o ./publish/psma --self-contained true pause 以管理员身份运行: 三、参考 https://docs.microsoft.com/zh-cn/dotnet/core/tools/dotnet-publish?tabs=netcore21 来源: https://www.cnblogs.com/willingtolove/p/11960434.html