publish

Django之查询知识点总结

我只是一个虾纸丫 提交于 2019-12-18 02:30:27
models.Book.objects.filter(**kwargs).values_list(title) : querySet [(),(),()] models.Book.objects.filter(**kwargs): querySet [obj1,obj2] models.Book.objects.filter(**kwargs).values(*args) : querySet [{},{},{}] 跨表查询总结: 1、创建表 class Book(models.Model):   title = models.CharField(max_length=32)   publish=models.ForeignKey("Publish") # 创建一对多的外键字段   authorList=models.ManyToManyField("Author") # 多对多的关系,自动创建关系表 class Publish(models.Model):   name = models.CharField(max_length=32)   addr = models.CharField(max_length=32) class Author(models.Model):   name=models.CharField(max_length=32)   age=models

My app is not available for tablet device on Google play

ⅰ亾dé卋堺 提交于 2019-12-18 02:03:43
问题 I published my app 2 days ago on Google Play. For some reasons i can only see it in my phone's Google Play. If i search it on my Samsung Galaxy Tab, it does not appear. In manifest.xml i didnt wrote anything like: android:largeScreens="false" in addition, this tag is set "true" by default, as far as i know. Can anybody tell me something about this issue? On Web browser's Google play i see this info: This app is compatible with some of your devices. -Samsung GT-P7500 This item is not

My app is not available for tablet device on Google play

会有一股神秘感。 提交于 2019-12-18 02:03:07
问题 I published my app 2 days ago on Google Play. For some reasons i can only see it in my phone's Google Play. If i search it on my Samsung Galaxy Tab, it does not appear. In manifest.xml i didnt wrote anything like: android:largeScreens="false" in addition, this tag is set "true" by default, as far as i know. Can anybody tell me something about this issue? On Web browser's Google play i see this info: This app is compatible with some of your devices. -Samsung GT-P7500 This item is not

Django初探

南楼画角 提交于 2019-12-18 00:33:56
MVC和MTV模式 著名的MVC模式:所谓MVC就是把web应用分为模型(M),控制器(C),视图(V)三层;他们之间以一种插件似的,松耦合的方式连接在一起。 模型负责业务对象与数据库的对象(ORM),视图负责与用户的交互(页面),控制器(C)接受用户的输入调用模型和视图完成用户的请求。 Django的MTV模式本质上与MVC模式没有什么差别,也是各组件之间为了保持松耦合关系,只是定义上有些许不同,Django的MTV分别代表: Model(模型):负责业务对象与数据库的对象(ORM) Template(模版):负责如何把页面展示给用户 View(视图):负责业务逻辑,并在适当的时候调用Model和Template 此外,Django还有一个url分发器,它的作用是将一个个URL的页面请求分发给不同的view处理,view再调用相应的Model和Template django的流程和命令行工具 1、 django 实现流程 django #安装: pip3 install django# 创建project django-admin startproject mysite(项目名) ---mysite ---settings.py ---url.py ---wsgi.py ---- manage.py(启动文件) # 创建APP python mannage.py startapp

ORM之多表操作

狂风中的少年 提交于 2019-12-18 00:30:38
一、创建模型 from django.db import models # Create your models here. class Book(models.Model): nid = models.AutoField(primary_key=True) title = models.CharField( max_length=32) publishDate=models.DateField() price=models.DecimalField(max_digits=5,decimal_places=2) # 与Publish建立一对多的关系,外键字段建立在多的一方 publish=models.ForeignKey(to="Publish",to_field="nid",on_delete=models.CASCADE) # 与Author表建立多对多的关系,ManyToManyField可以建在两个模型中的任意一个,自动创建第三张表 authors=models.ManyToManyField(to='Author',) class Author(models.Model): nid = models.AutoField(primary_key=True) name=models.CharField( max_length=32) age=models

How to take web app offline while publishing?

人盡茶涼 提交于 2019-12-17 18:45:09
问题 Very often, when I hit Publish in VS13, I get the site to compile but when uploading I get the error saying that a file is busy. Updating file (MyAzureSite\PrecompiledApp.config). C:...\v12.0\Web\Microsoft.Web.Publishing.targets(4255,5): Error ERROR_FILE_IN_USE: Web deployment task failed. (The file 'PrecompiledApp.config' is in use. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.) When I follow the link provided, it's suggested that I should go for enabling

MS Visual Studio: How to exclude certain Project Folders from publishing?

倖福魔咒の 提交于 2019-12-17 15:38:16
问题 I have certain folders which I want to keep in the project but not to include it in publishing. Is that possible? 回答1: Michael is totally right, through editing the .csproj file you can manually exclude files/folder from being published. One easier way if you don't want to mess with the .csproj file is to highlight the file(s) inside the VS solution explorer. Under the properties panel, change build to action from 'content' to 'none'. This way you don't have to unload the project from the

Using msbuild to execute a File System Publish Profile

送分小仙女□ 提交于 2019-12-17 06:31:44
问题 I have a c# .Net 4.0 project created with VS2010 and now being accessed with VS2012. I'm trying to publish only the needed files from this website to a destination location (C:\builds\MyProject[Files]) My file structure: ./ProjectRoot/MyProject.csproj ./ProjectRoot/Properties/PublishProfiles/FileSystemDebug.pubxml I'm running the following via MSBuild: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe ./ProjectRoot/MyProject.csproj /p:DeployOnBuild=true /p:PublishProfile=./ProjectRoot

node实现即时消息通知

天涯浪子 提交于 2019-12-17 03:27:29
关于这个项目,是关于我们设计模式的案例设计 题目是重构我们教务在线的教师端,实现消息通知 也就是说,当教师的监考发生变动时,就产生即时的消息。 刚刚看的这个题目,我想到的是,利用观察者模式,在JavaScript中,观察者模式又称为发布订阅模式。 对于教师端来说,教师就是订阅者,管理员发布更新监考事宜为发布事件。教师订阅了“更新监考”这个事件,一旦管理员触发事件,则教师会收到消息。 如何实现呢? 1. 发布事件 这件事的过程,实际上是,管理员端向后端提交更新的数据,触发了更新监考事件,服务器端主动向客户端推送其订阅的消息。 首先,管理员向后端提交更新的数据:这件事非常好实现,管理员向后端发起post请求,即可提交更新。 然后,触发更新事件,如何触发事件呢?如何实现服务端向客户端推送消息呢? 2. 推送消息 WebSocket 是 HTML5 开始提供的一种在单个 TCP 连接上进行全双工通讯的协议。 WebSocket 使得客户端和服务器之间的数据交换变得更加简单,允许服务端主动向客户端推送数据。在 WebSocket API 中,浏览器和服务器只需要完成一次握手,两者之间就直接可以创建持久性的连接,并进行双向数据传输。 浏览器通过 JavaScript 向服务器发出建立 WebSocket 连接的请求,连接建立以后,客户端和服务器端就可以通过 TCP 连接直接交换数据。 当你获取

【1024 | Day52】Django基础之模型层(models.py)

 ̄綄美尐妖づ 提交于 2019-12-16 23:59:40
目录 Django基础之模型(models)层(上) 1. 单表查询 1.1 增删改查 1.2 必知必会13条 1.3 双下划线查询(升级!!!) 2. 多表查询 2.1 外键的字段的增删改查 2.2 表与表之间的关联查询 3. 拓展 正反向概念: Django基础之模型(models)层(上) Django测试环境搭建: 拷贝manage.py中的行代码放到tests.py文件中导入模块 import django`,`django.setup() 如果你想查看orm语句内部真正的sql语句有2种方法: 1.如果是queryset对象,就可以.query查看该queryset对象的内部sql语句 2.在 settings.py 文件中配置 LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'handlers': { 'console': { 'level': 'DEBUG', 'class': 'logging.StreamHandler', }, }, 'loggers': { 'django.db.backends': { 'handlers': ['console'], 'propagate': True, 'level': 'DEBUG', }, }} 1. 单表查询 1.1 增删改查 增 方式一: