Access an item in ListProperty

56 views Asked by At

I have a Model like below

class XXX(db.Model):
    f_list = db.ListProperty(int,indexed=True) #Store 50000 numbers

How to access the 3rd item in f_list?

1

There are 1 answers

0
Tim Hoffman On BEST ANSWER

You would use a standard list indexing operation to access the 3rd item in the list

some_obj.f_list[2]

However the entire entity will be loaded into memory when you fetch an instance of XXX

There is no way around it with the model you have.

Even a projection query will return the entire list.

The only possibility would be to start creating multiple sub entities.