I have some questions. Suppose we have this Model for Datastore:
SESSIONID = db.StringProperty()
userid = db.StringProperty()
userip = db.StringProperty()
exp_time = db.IntegerProperty()
from models import User # Assuming you have user model class in models user = User.query().filter(User.SESSIONID==1234).get()
Now user will contain object or objects(depending on uniqueness of SESSIONID) of User class, so to get userid just do:
id = user.userid
Hope it helps.
PS: Read the documentation mentioned by Daniel, that will help you a lot.