[web2py] Re: Google datastore concepts - denormalising and list:reference fields

2011-08-21 Thread fishwebby
Ah ok, that makes sense. Is it really that easy to come up with a web request that takes more than thirty seconds? I'll have to watch out for that... I'm thinking now that I'm going about this the wrong way as regards the design for the datastore - from what I've read, contains is an efficient

[web2py] Re: Google datastore concepts - denormalising and list:reference fields

2011-08-21 Thread howesc
the 30 second timeout can be hit if you are doing something that triggers a few hundred sub-queries. contains is very nice. yes it's then a pain to add/remove items from the list, but GAE is all about query efficiency at the expense of write efficiency. cfh

[web2py] Re: Google datastore concepts - denormalising and list:reference fields

2011-08-20 Thread howesc
right, so when i need to do a belongs query for more than 30 items: items=db(db.my_table.end_user.belongs(id_list[0:30])).select() for i in range(30, len(id_list)+30, 30): items = items \ db(db.my_table.end_user.belongs(id_list[i-30:i])).select() i'd say that

[web2py] Re: Google datastore concepts - denormalising and list:reference fields

2011-08-19 Thread howesc
some thoughts. - belongs can only have 30 items in it per execution. GAE limitation - i do many-to-many on GAE by using join tables, i just have to do more queries. it does mean that you can't return 100 courses plus all the students in the course in a single query (if say each course

[web2py] Re: Google datastore concepts - denormalising and list:reference fields

2011-08-19 Thread fishwebby
That's good to know, thanks - so for more than 30 items, something like this people = db(db.person.id.belongs(course.students)).select() isn't possible? Would it be possible for you to give me an example of using join tables? (I think my brain is still in SQL mode and I can't work out how I'd

[web2py] Re: Google datastore concepts - denormalising and list:reference fields

2011-08-17 Thread fishwebby
(posting Massimo's reply) e.g. 1, Physics 101, 4|5|6 Is that how data has to be modelled using the GAE datastore? No. On GAE 'list:reference' maps into a ListProperty of integers If so, is it possible to do the following: - paginate the denormalised data, for example show a paginated list

[web2py] Re: Google datastore concepts - denormalising and list:reference fields

2011-08-17 Thread fishwebby
So it sounds like it's possible to do what I want, although if I do want to do many to many perhaps GAE isn't the best fit. I'm going to persevere and see if I can get it working, as GAE is very attractive as a hosting option where I don't have to worry at all about scaling, server maintenance or

[web2py] Re: Google datastore concepts - denormalising and list:reference fields

2011-08-17 Thread fishwebby
- paginate the denormalised data, for example show a paginated list of students on a course? You cannot. ListProperty does not allow this. How about something like this? limitby = (0, 10) students = db(db.student.id.belongs(course.students)).select(limitby = limitby) (where