Here is a working example.  Run it in the local SDK's 'interactive console.'

Robert



class TestExpando(db.Expando):
  myprop = db.IntegerProperty()


new1 = TestExpando(myprop=1)
new1.myprop2 = 'a'
new1.put()

new2 = TestExpando(myprop=2)
new2.myprop2 = 'a'
new2.put()

new3 = TestExpando(myprop=3)
new3.myprop3 = 9
new3.put()

new4 = TestExpando(myprop=3)
new4.myprop2 = 'b'
new4.put()

query1 = TestExpando().all().filter('myprop =', 3)
print 'query1:'
for ent in query1:
  print "  myprop=%d, dynamic: %s" % (ent.myprop, ent.dynamic_properties())

query2 = TestExpando().all().filter('myprop2 =', 'a')
print 'query2:'
for ent in query2:
  print "  myprop=%d, myprop2: %s " % (ent.myprop, ent.myprop2)








On Mon, Jul 12, 2010 at 8:58 AM, Massimiliano
<[email protected]> wrote:
> Could be the Exapando model? Have I to set something?
> Could you help me?
>
> 2010/7/11 Massimiliano <[email protected]>
>>
>> There is a space!
>>
>> 2010/7/11 Robert Kluin <[email protected]>
>>>
>>> Hey Max,
>>>   Try adding a space between your property name and the operation.
>>>   db.Query(PAGAMENTI).filter('password =', password).fetch(limit=1)
>>>
>>> Robert
>>>
>>>
>>>
>>> On Jul 11, 2010, at 10:41, Massimiliano <[email protected]>
>>> wrote:
>>>
>>> The user have a password that they can us to leave a message. So I check
>>> if the password is right and if the password has been used. But the if is
>>> failing for both the and (if remove one it still doesn't work), as he can't
>>> compare it and the fetch has no result.
>>>
>>> 2010/7/11 Alon Carmel <[email protected]>
>>>>
>>>> are you saving your passwords as clear passwords?
>>>> can you elaborate a bit more? why are you checking for password on two
>>>> tables?
>>>> -
>>>> Cheers,
>>>> def AlonCarmel(request)
>>>>      import simplejson as json
>>>>      contact = {}
>>>>      contant['email'] = '[email protected]';
>>>>      contact['twitter'] = '@aloncarmel';
>>>>      contact['web'] = 'http://aloncarmel.me';
>>>>      contact['phone'] = '+972-54-4860380';
>>>>      return HttpResponse(json.dumps(contact))
>>>>
>>>> * If you received an unsolicited email from by mistake that wasn't of
>>>> your matter please delete immediately. All E-mail sent from Alon Carmel is
>>>> copyrighted to Alon Carmel 2008. Any details revealed in e-mails sent by
>>>> Alon Carmel are owned by the Author only. Any attempt to duplicate or
>>>> imitate any of the Content is prohibited under copyright law 2008.
>>>>
>>>>
>>>>
>>>> On Sun, Jul 11, 2010 at 4:59 PM, Massimiliano
>>>> <[email protected]> wrote:
>>>>>
>>>>> Hi all,
>>>>> I'm trying to check the password of my user. But it doesn't want to
>>>>> work.
>>>>> class PAGAMENTI(db.Expando):
>>>>> data = db.DateTimeProperty(auto_now_add=True)
>>>>> class BIG(db.Expando):
>>>>> data = db.DateTimeProperty(auto_now_add=True)
>>>>> class BigHandler(webapp.RequestHandler):
>>>>> def get(self):
>>>>> ......
>>>>> def post(self):
>>>>> password = self.request.get('password')
>>>>> controllo = db.Query(PAGAMENTI).filter('password=',
>>>>> password).fetch(limit=1)
>>>>> controllo2 = db.Query(BIG).filter('password=', password).fetch(limit=1)
>>>>> if len(controllo) == 1 and len(controllo2) == 0:
>>>>> big = BIG()
>>>>> big.nome = self.request.get('nome')
>>>>> big.msg = self.request.get('msg')
>>>>> big.password = password
>>>>> big.put()
>>>>> self.redirect('/big')
>>>>> Could you please help me. The if doesn't work, It always goes in the
>>>>> else.
>>>>> Thanks
>>>>> Max
>>>>>
>>>>> --
>>>>>
>>>>> My email: [email protected]
>>>>> My Google Wave: [email protected]
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Google App Engine" group.
>>>>> To post to this group, send email to [email protected].
>>>>> To unsubscribe from this group, send email to
>>>>> [email protected].
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/google-appengine?hl=en.
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Google App Engine" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to
>>>> [email protected].
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/google-appengine?hl=en.
>>>
>>>
>>>
>>> --
>>>
>>> My email: [email protected]
>>> My Google Wave: [email protected]
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Google App Engine" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-appengine?hl=en.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Google App Engine" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-appengine?hl=en.
>>
>>
>>
>> --
>>
>> My email: [email protected]
>> My Google Wave: [email protected]
>
>
>
> --
>
> My email: [email protected]
> My Google Wave: [email protected]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to