English 中文(简体)
GAE 发现有没有列入清单的项目的实体
原标题:GAE find entities with item not in ListProperty

在我通过用户之间的信息时,我没有什么用处。 我的信息模式就是这样。

class Message(db.Model):
    from = db.UserProperty()
    sent_to_users = db.ListProperty(db.Key)

如果用户上网,我就会向用户发出这一信息,因此,当我发现用户是在线用户时,我会发出任何尚未发送的信息。 http://code.google.com/appengine/docs/python/xmpp/overview.html#Handling_User_Presence” rel=“nofollow”/chat/presence/ availablehandler 。 表示已向<代码>用户发送了电文。

我的问题是,我如何过滤已经发给用户的信息。 http://code.google.com/appengine/docs/python/datashop/queries.html#Overview” rel=“nofollow”查询质量过滤器, acode>!=, 翻译到两个查询的查询比结果多或少。 不用说,在关键人物名单上没有工作。 Basically members_not_sent_message = 信.all().filter( sent_to_users !=, available_user).fetch(100) do not work.

是否有办法不把价值观列入清单,或者我是否必须逐项处理,找到尚未发出的信息? 或者还有另一个系统设计,像这个系统,绕过了GAE数据储存限制(如果是这种情况)?

最佳回答

名单上的过滤器质量不高,实际上并不可行。 如你所知,不平等过滤器在hood子下单独进行“价值低于值”和“超出价值”的查询,然后压缩结果。 具有多种价值的清单特性将受到同一指数的多重影响,这样,如果你过滤一个物品,你总是会打另一个。

考虑保留两个清单:除了sent list外,还保留not_sent/ list,并询问:

问题回答

正如其他人指出的那样,你可以不这样做。 你们不要使用清单来追踪能够无限制地增长的任何情况,尽管如此,如不读的信息,因为清单编制工作的规模难以控制。 相反,在发出信号时,你应该有旗帜,表明这些信号如被发送/阅读。





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...