publish

android facebook publish photo

你说的曾经没有我的故事 提交于 2019-11-30 04:08:00
After looking on the net for 2 days I finally decided to post on SO. Well I simply want to publish a photo in my android app on to facebook. AM using the official android-facebook-sdk. I imported to example project and in the upload section add my code to upload photo. like mUploadButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { Bundle params = new Bundle(); params.putString("method", "photos.upload"); Bitmap temp = BitmapFactory.decodeResource(getResources(),R.drawable.facebook_icon); ByteArrayOutputStream baos = new ByteArrayOutputStream(); temp.compress(Bitmap

三 .复习python的 ORM 操作

南笙酒味 提交于 2019-11-30 03:49:33
一.ORM连表高级操作 https://www.cnblogs.com/yuanchenqi/articles/8963244.html from django.db import models # 作者 class Author(models.Model): nid = models.AutoField(primary_key=True) name=models.CharField( max_length=32) age=models.IntegerField() # 与AuthorDetail建立一对一的关系 authorDetail=models.OneToOneField(to="AuthorDetail",on_delete=models.CASCADE) # 作者地址 class AuthorDetail(models.Model): nid = models.AutoField(primary_key=True) birthday=models.DateField() telephone=models.BigIntegerField() addr=models.CharField( max_length=64) # 出版社 class Publish(models.Model): nid = models.AutoField(primary_key=True)

Django单表,连表查询

自作多情 提交于 2019-11-30 03:42:38
今日内容: 模型层(orm模型表) 数据库 记录 1,在djang中新增测试脚本 1,可以在根目录下新建一个py文件。列如test.py文件 2,在文件中写入以下代码即可 #!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "day55.settings") import django django.setup() 2,单表操作 1,表的字段增删改查 2,记录的增删改查 3,神奇的双下滑查询 """ 查看orm内部sql语句的方法有哪些 1.如果是queryset对象 那么可以点query直接查看该queryset的内部sql语句 2.在django项目的配置文件中 配置一下参数即可实现所有的orm在查询的时候自动打印对应的sql语句 LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'handlers': { 'console':{ 'level':'DEBUG', 'class':'logging.StreamHandler', }, }, 'loggers': { 'django.db.backends': {

django模型层之多表关系

梦想的初衷 提交于 2019-11-30 03:41:06
一. 多表操作   数据库表关系之关联字段与外键约束   一对多   book(多)   publish(一)   查询<<水浒传>>这本书出版社的地址: select publish_id from Book where title="水浒传" select addr from Publish where id=1   一旦确定了一对多的关系: 建立一对多的关系,在多的一方建立关联字段(publish_id)   多对多:   book   author   book2author:   panshao出版过得书籍名称(子查询) select id from author where name='panshao'; # 在作者表中拿出panshao select book_id from book2author where author_id=1; # 找出作者id等于1的书籍的id select title from book where id=book_id;   一旦确定表关系是多对对: 创建第三张表 id book_id author_id   一对一:   author   authordetail   一旦确定是一对多的关系: 建立一对多的关系=======>在多的表中建立关联字段 (一个出版社可以出版多本书)   一旦确定为多对多的关系: 建立多对多的关系=====

orm常用字段和参数,F与Q查询

左心房为你撑大大i 提交于 2019-11-30 03:35:11
多表操作 图书管理系统表创建 一对多: ForeignKey 一对一: OnoToOneField 可以用ForeignKey代替ForeignKey(unique=True) 上面两个关键字所创建出来的字段会自动加上_id后缀 多对多: ManyToManyFiled, 该字段并不会真正的在表中展示出来 它仅仅是一个虚拟字段,告诉orm自动创建第三种表,帮助orm跨表查询 models.py文件夹from django.db import models # Create your models here. class Book(models.Model): title = models.CharField(max_length=255) price = models.DecimalField(max_digits=8,decimal_places=2) # 八位数字,小数占两位 publish_date = models.DateField(auto_now_add=True) # 库存数 kucun = models.IntegerField(null=True) # 卖出数 maichu = models.IntegerField(null=True) publish = models.ForeignKey(to='Publish') #

四十九、django单表操作,多表操作,一对多,多对多,分组查询,聚合查询,F、Q查询

半腔热情 提交于 2019-11-30 03:33:20
单表操作:   - 增删改查 # 增 # 方式1: create # book_obj = models.Book.objects.create(title='三国',price=19.99,create_time='2019-11-11') # print(book_obj.title) # 方式2:对象点save()方法 # from datetime import datetime # ctime = datetime.now() # book_obj = models.Book(title='三国演义',price=96.66,create_time=ctime) # book_obj.save() # 查 # print(models.Book.objects.all()) # print(models.Book.objects.get(id=1)) # print(models.Book.objects.get(pk=1)) """ pk会自动查找到当前数据的主键字段 """ # print(models.Book.objects.filter(pk=2)) # 改 # 1.update # models.Book.objects.filter(pk=1).update(title='三国演义') # 2.对象.save() # book_obj = models

Python Django 模型层02

微笑、不失礼 提交于 2019-11-30 03:33:16
一 模型层常用字段和参数 1.模型表建立常用字段 1. AutoField:int自增主键列。必须填入参数 primary_key=True。当model中如果没有自增列,则自动会创建一个列名为id的列 id = models.AutoField(primary_key=True) 2.CharField:字符串,相当于varchar。必须提供max_length参数,不能超过255。 title = models.CharField(max_length=255) 3.IntegerField:整数类型,范围在 -2147483648 to 2147483647。(一般不用它来存手机号(位数也不够),直接用字符串存,) kucun = models.IntegerField(null=True) # null参数可不填 4.DecimalField:浮点类型。参数1 max_digits表示总共的位数,参数2 decimal_places表示小数的位数 price = models.DecimalField(max_digits=8,decimal_places=2) 5.DateField: create_time = models.DateField() # 不指定auto_now或auto_now_add时,需要自己传参数 关键性的参数: 1.auto_now:每次操作数据

How to publish a Web Service from Visual Studio into IIS?

女生的网名这么多〃 提交于 2019-11-30 03:21:29
I have written a WCF web service in C#. I had originally self-hosted it and then decided to host it on IIS running locally on my PC. While the service is working, there are several aspects of the deployment process that I don't understand: Firstly, the URL of this service when hosted in IIS does not correspond to what I specified in my web.config. I had specified " http://localhost:8000/MyServices/OrderService " there and this was used when I self-hosted. Now that I've deployed to IIS, the URL has become " http://localhost/MyServices/OrderService ". Why is the URL not picked up from my config

scrapy爬虫之爬取豆瓣小说简介(七)

浪尽此生 提交于 2019-11-30 01:18:19
一、概述 1.1、通过pycharm创建一个scrapy工程 1、参考下面的博客创建scrapy工程 pycharm创建scrapy项目 2、项目目录如下 3、文件说明 scrapy.cfg :项目的配置信息,主要为Scrapy命令行工具提供一个基础的配置信息。(真正爬虫相关的配置信息在settings.py文件中) items.py : 设置数据存储模板,用于结构化数据,如:Django的Model pipelines : 数据处理行为,如:一般结构化的数据持久化 settings.py : 配置文件,如:递归的层数、并发数,延迟下载等 spiders : 爬虫目录,如:创建文件,编写爬虫规则 1.2、编写工程启动类 1、自动生成网站爬虫spider类 使用scrapy genspider 命令生成爬取豆瓣网站的爬虫类 scrapy genspider douban https : // book . douban . com / 示例: name : 用于区别Spider。 该名字必须是唯一的,您不可以为不同的Spider设定相同的名字。 start_urls : 包含了Spider在启动时进行爬取的url列表。 因此,第一个被获取到的页面将是其中之一。 后续的URL则从初始的URL获取到的数据中提取。 parse() :是spider的一个方法。 被调用时

Publish a Web Application from the Command Line

瘦欲@ 提交于 2019-11-30 00:24:56
I've got a series of .NET 4 based web applications (WCF and Web) within the same solution, but need to selectively publish, from the command line. I've tried various things so far, MSBuild, aspnet_compiler, but nothing, to date has worked. I need to be able to specify the Project, not the solution, have any transforms run and have the output redirected to a folder...basically mimick the right mouse click 'Publish' option, using the File System. In addition to all of this, I'd like to leave the projects alone - not adding msbuild files all over the place, as this is a specific build, and not