contentType

ContentType matching query does not exist on post_syncdb

三世轮回 提交于 2020-01-21 08:40:07
问题 I am trying to add add some data to the database as soon as tables are created, using the post_syncdb signal. signals.post_syncdb.connect(init) Then in the init function, I want to set permission, so I use ct = ContentType.objects.get(app_label='news', model='Article') Permission(name='Approve articles', codename='can_approve_article', content_type=ct) But if I drop all the tables and run syncdb , I get ... File "...\base\functions\init.py", line 11, in init ct = ContentType.objects.get(app

MVC 4 Export to Excel Failing

≡放荡痞女 提交于 2019-12-25 02:06:30
问题 I have the following code in a controller in and MVC 4 application Response.AddHeader("Content-Disposition", "attachment; filename=export.xml"); Response.AddHeader("Content-type", "vnd.openxmlformats-officedocument.spreadsheetml.sheet"); var rows = data.Split('\n'); var sheet = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine; sheet += "<?mso-application progid=\"Excel.Sheet\"?>" + Environment.NewLine; sheet += "<ss:Workbook xmlns:ss=\"urn:schemas-microsoft-com:office

How to set Content-Type of a Webbrowser Control?

隐身守侯 提交于 2019-12-24 08:24:47
问题 Is it possible to set the Content-Type of a document in a webbrowser control? For example how can I show an XML document rendered as XML in a webbrowser control by using DocumentText? 回答1: Try add an extension to your IMoniker::GetDisplayName implementation. This will cause the URL moniker to look under HKEY_CLASSES_ROOT.??? keys for mime types. Then you can use the webbrowser's documen's IPersistMoniker interface to load the moniker. 来源: https://stackoverflow.com/questions/2570592/how-to-set

SharePoint 2010: RemoveFieldRef and Inherits=“TRUE”

痞子三分冷 提交于 2019-12-21 04:29:12
问题 I have created a custom content type that inherits from the OOTB SharePoint Picture content type. The only customisations I have made is to add a simple URL field, and remove two of the fields on the base type. See below: <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <!-- Parent ContentType: Picture (0x010102) --> <ContentType ID="0x0101020027f16ab27e6e45a6848c25c47aaa7053" Name="Custom Picture" Description="" Group="Custom" Inherits="TRUE" Version="0"> <FieldRefs>

Limit of 88 bytes on response.write?

我们两清 提交于 2019-12-12 00:33:09
问题 I am trying to serve a csv file from a wcf service, as a string response. It looks like this: HttpContext.Current.Response.AddHeader("Content-disposition", "attachment; filename=ImportErrors.csv"); HttpContext.Current.Response.ContentType = "text/csv"; HttpContext.Current.Response.Write(myCsvContent); The response StatusCode is set to (int)HttpStatusCode.OK (200) It works, but I am only getting 88 bytes of my csv and the rest is cut off (not shown). Any suggestions on where to look? I don't

Setting content type/ encoding in Jersey REST Client

梦想与她 提交于 2019-12-07 03:26:38
问题 HI I have been trying to call REST POST API using jersey REST Client. The API is docs is URL: METHOD: POST Header Info:- X-GWS-APP-NAME: XYZ Accept: application/json or application/xml My Sample Jersey client code is Client client = Client.create(); WebResource resource=client.resource(URL); resource.accept(javax.ws.rs.core.MediaType.APPLICATION_XML); resource.type(javax.ws.rs.core.MediaType.APPLICATION_XML); resource.type("charset=utf-8"); ClientResponse response = resource.post

SharePoint 2010: RemoveFieldRef and Inherits=“TRUE”

独自空忆成欢 提交于 2019-12-03 14:04:34
I have created a custom content type that inherits from the OOTB SharePoint Picture content type. The only customisations I have made is to add a simple URL field, and remove two of the fields on the base type. See below: <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <!-- Parent ContentType: Picture (0x010102) --> <ContentType ID="0x0101020027f16ab27e6e45a6848c25c47aaa7053" Name="Custom Picture" Description="" Group="Custom" Inherits="TRUE" Version="0"> <FieldRefs> <RemoveFieldRef ID="{b66e9b50-a28e-469b-b1a0-af0e45486874}" Name="Keywords" /> <RemoveFieldRef ID="{a5d2f824-bc53

ContentType matching query does not exist on post_syncdb

天涯浪子 提交于 2019-12-01 08:36:01
I am trying to add add some data to the database as soon as tables are created, using the post_syncdb signal. signals.post_syncdb.connect(init) Then in the init function, I want to set permission, so I use ct = ContentType.objects.get(app_label='news', model='Article') Permission(name='Approve articles', codename='can_approve_article', content_type=ct) But if I drop all the tables and run syncdb , I get ... File "...\base\functions\init.py", line 11, in init ct = ContentType.objects.get(app_label='news', model='Article') ... django.contrib.contenttypes.models.DoesNotExist: ContentType matching

解决illegal to have multiple occurrences of conte...

心已入冬 提交于 2019-11-28 09:51:14
如果碰见了illegal to have multiple occurrences of contentType with different values的问题 不用想 肯定是编码的问题gb2312或者utf-8或者ISO8859-1或者gbk什么什么 一定要注意编码 不然一个小问题都整半天 ————————————————————————————————————————————————— 解决illegal to have multiple occurrences of contentType with different values错误 作者:吕海鹏 文章来源:itstudy原创 发表时间:2008-9-27 12:01:40 阅读次数:今日:3 本周:19 本月:24 总计:3972 今天写jsp程序,在一个文件中包含了另一个文件(checkPurview.jsp)来做权限验证,可执行候却出现执行错误: org.apache.jasper.JasperException: /admin/adminUser/../incs/checkPurview.jsp(1,1) Page directive: illegal to have multiple occurrences of contentType with different values (old: text/html

contentType 与pageEncoding区别

南楼画角 提交于 2019-11-28 09:51:02
一、contentType 与pageEncoding区别 contentType -- 指定的是JSP页最终 Browser(客户端)所见到的网页内容的编码. 就是 Mozilla的 Character encoding, 或者是 IE6的 encoding. 例如 JSPtw Forum 用的contentType就是 Big5. pageEncoding -- 指定JSP编写时所用的编码 如果你的是 WIN98, 或 ME 的NOTEPAD记事本编写JSP, 就一定是常用的是Big5 或 gb2312, 如果是用 WIN2k winXP的NOTEPAD时, SAVE时就可以选择不同的编,码, 包括 ANSI(BIG5/GB2312)或 UTF-8 或 UNIONCODE(估是 UCS 16). editor的编码 就是控制pageencoding 编码的 二、jsp编码过程 JSP要经过 两次的"编码": 第一阶段会用 pageEncoding 第二阶段会用 utf-8 至utf-8 第三阶段就是由TOMCAT出来的网页, 用的是contentType. 阶段一 是 JSPC的 JSP至JAVA(.java)原码的"翻译", 它会跟据 pageEncoding 的设定读取JSP. 结果是 由指定的 pageEncoding(utf-8,Big5,gb2312)的JSP