在经典模式下在IIS 7.0上启用Web服务的配置文件设置是什么?该站点必须位于经典模式应用程序池中,因为报表查看器控制在集成模式下运行时崩溃.但是,在经典模式应用程序池中,webservices会生成以下错误消息:
请求的内容似乎是脚本,静态文件处理程序不会提供.
•如果要将此内容作为静态文件提供,请添加显式MIME映射
编辑 - 附加错误消息信息:
注意:此应用程序的特定实例将在共享主机环境中的客户帐户中运行,因此不会/无法访问IIS UI.专门寻求配置文件调整.
我正在创建一个需要数字签名(MD5哈希)的顺序文件.在创建顺序文件的同时,我也在创建一个具有相同数据的动态数组.如果我在顺序文件和动态数组上执行MD5哈希,我可以期望结果相同或不同吗?
bulkoader.yaml:
transformers:
- kind: ExampleModel
connector: csv
property_map:
- property: __key__
external_name: key
export_transform: transform.key_id_or_name_as_string
- property: data
external_name: data
- property: type
external_name: type
Run Code Online (Sandbox Code Playgroud)
model.py:
class ExampleModel(db.Model):
data = db.TextProperty(required=True)
type = db.StringProperty(required=True)
Run Code Online (Sandbox Code Playgroud)
一切似乎都很好,但是当我上传时我得到了这个错误:
BadValueError: Property data is 24788 bytes long; it must be 500 or
less. Consider Text instead, which can store strings of any length.
出于某种原因,它认为数据是字符串属性.
任何人都知道如何解决这个问题?
google-app-engine bigtable data-import google-cloud-datastore
我对之字形合并联接算法有疑问。在https://developers.google.com/appengine/articles/indexselection文章中,提到
Index(Photo, owner_id, -date),
Index(Photo, size, -date)
Run Code Online (Sandbox Code Playgroud)
可以结合成为
Index(Photo, owner_id, size, -date) ;
Run Code Online (Sandbox Code Playgroud)
我的测试如下:
<datastore-index kind="KindTest1" ancestor="false" source="auto">
<property name="hideIt" direction="asc"/>
<property name="voteCount" direction="desc"/>
</datastore-index>
<datastore-index kind="KindTest1" ancestor="false" source="auto">
<property name="hideIt" direction="asc"/>
<property name="createdByDate" direction="asc"/>
</datastore-index>
can these 2 indexes combine to become,
<datastore-index kind="KindTest1" ancestor="false" source="auto">
<property name="hideIt" direction="asc"/>
<property name="createdByDate" direction="asc"/>
<property name="voteCount" direction="desc"/>
</datastore-index>
Run Code Online (Sandbox Code Playgroud)
我之所以向您发送电子邮件是因为,当我在开发和生产环境中尝试此操作时,它不起作用,并且需要具有每个单独的索引。可以详细说明吗?
如果我选择查询repeated属性,我是否会对查询性能支付罚金?例如:
class User(ndb.Model):
user_name = ndb.StringProperty()
login_providers = ndb.KeyProperty(repeated=true)
fbkey = ndb.Key("ProviderId", 1, "ProviderName", "FB")
for entry in User.query(User.login_providers == fbkey):
# Do something with entry.key
Run Code Online (Sandbox Code Playgroud)
VS
class User(ndb.Model)
user_name = ndb.StringProperty()
class UserProvider(ndb.Model):
user_key = ndb.KeyProperty(kind=User)
login_provider = ndb.KeyProperty()
for entry in UserProvider.query(
UserProvider.user_key == auserkey,
UserProvider.login_provider == fbkey
):
# Do something with entry.user_key
Run Code Online (Sandbox Code Playgroud)
根据GAE的文档,似乎Datastore负责索引,而第一个不那么详细的选项就是使用索引.但是,我没有找到任何文件证实这一点.
编辑
UserProvider第二个示例的唯一目的是在用户和它的login_provider之间创建一对多关系.我想了解是否值得创建第二个实体而不是查询repeated属性.此外,假设我所需要的只是来自的关键User.
我试图找出一种优雅的方法来查询 AppEngine 数据存储区中具有特定属性的所有实体。由于缺少属性的实体不包含在索引中,基本上我想要做的是检索给定属性的索引。我确信可以做类似的事情:
Filter bigger = new FilterPredicate(PROPERTY,
FilterOperator.GREATER_THAN_OR_EQUAL,
0);
Filter smaller = new FilterPredicate(PROPERTY,
FilterOperator.LESS_THAN_OR_EQUAL,
0);
Filter present = CompositeFilterOperator.or(bigger, smaller);
Query q = new Query(KIND).setFilter(present);
Run Code Online (Sandbox Code Playgroud)
但它看起来不像是一个非常优雅(或有效)的解决方案。有人有更好的主意吗?
在谷歌应用程序引擎中,是否可以查询数据库只获取某些列?
例如,我有一个模型定义如下:
class userData(ndb.Model):
id = ndb.StringProperty()
name = ndb.StringProperty()
emailAddress = ndb.StringProperty()
Run Code Online (Sandbox Code Playgroud)
我通常查询db如下:
userData.query().filter(ndb.GenericProperty('id') == "requiredId").fetch()
Run Code Online (Sandbox Code Playgroud)
但这给了我包含id,姓名和电子邮件的结果.
现在我想只获取id和name但不是emailAddress.我怎样才能做到这一点?
谢谢!
python google-app-engine app-engine-ndb google-cloud-datastore
我的应用程序在App Engine上运行,但我想从我的Compute Engine VM访问其NDB DataStore实体来进行一些处理并将结果写回App Engine DataStore.我怎样才能做到这一点?
此外,Google Cloud DataStore和App Engine DataStore是一样的吗? https://developers.google.com/datastore/ https://developers.google.com/appengine/docs/python/ndb/
google-app-engine app-engine-ndb google-compute-engine google-cloud-datastore
我正在使用GAE(Google App Engine)数据存储来存储人员.
每个人都有一个名字,一个唯一的标记,他们收到的消息列表(字符串)和他们完成的测试列表(字符串).这些都是支持的类型.
但是,我还想存储一个包含String键和String值的HashMap,以及有关它们已完成的测试的信息.
我正在尝试保存的示例Map(请注意,这是示例数据,而不是实际数据)
[
<'test_easy_1', 'completed in 3 minutes'>
<'test_easy_2', 'completed in 5 minutes'>
<'test_hard_1', 'completed in 15 minutes'>
<'test_hard_2', 'completed in 3 minutes.. Did you cheat?'>
]
Run Code Online (Sandbox Code Playgroud)
我想拯救这样的人
@Override
public boolean savePerson(Person p) {
if (p.getEntity() == null) {
return false;
}
p.getEntity().setProperty("name", p.getName());
p.getEntity().setProperty("token", p.getToken());
p.getEntity().setProperty("messages", p.getMessages());
p.getEntity().setProperty("completedTests", p.getCompletedTests());
p.getEntity().setProperty("testInformation", p.getTestInformation()); // does not work
DatastoreServiceFactory.getDatastoreService().put(p.getEntity());
return true;
}
Run Code Online (Sandbox Code Playgroud)
现在我的问题:
如何将HashMaps作为对象属性保存到数据存储区?
我希望以一种方式执行此操作,我不必为HashMap创建整个类和新的数据存储区索引.但是,如果这是唯一的方法,我想知道如何这样做.谷歌搜索这并没有产生明确和明显的方式来处理这种情况.
我目前正在尝试测试一段代码,该代码在放入新实体之前在数据存储区上运行查询,以确保不会创建重复项.我写的代码在应用程序的上下文中工作正常,但我为这些方法编写的测试失败了.似乎我无法通过测试包的上下文中的查询访问放入数据存储区的数据.
一种可能性在于从输出goapp test内容如下:Applying all pending transactions and saving the datastore.在调用get和put方法之后打印出这一行(我用log语句验证了这一点).
我尝试关闭上下文并为不同的操作创建一个新的上下文,但不幸的是,这也没有帮助.下面是一个简单的测试用例,它放入一个对象,然后在其上运行查询.任何帮助,将不胜感激.
type Entity struct {
Value string
}
func TestEntityQuery(t *testing.T) {
c, err := aetest.NewContext(nil)
if err != nil {
t.Fatal(err)
}
defer c.Close()
key := datastore.NewIncompleteKey(c, "Entity", nil)
key, err = datastore.Put(c, key, &Entity{Value: "test"})
if err != nil {
t.Fatal(err)
}
q := datastore.NewQuery("Entity").Filter("Value =", "test")
var entities []Entity
keys, err := q.GetAll(c, &entities)
if err != nil {
t.Fatal(err)
}
if len(keys) …Run Code Online (Sandbox Code Playgroud) java ×2
bigtable ×1
data-import ×1
go ×1
iis-7 ×1
md5 ×1
python ×1
u2 ×1
unidata ×1
unit-testing ×1
web-config ×1
web-services ×1