@@ -0,0 +1,846 @@
+#%0A#%0A# __     ___       ____       %0A# %5C %5C   / (_)_ __ / ___%7C ___  %0A#  %5C %5C / /%7C %7C '__%7C %7C  _ / _ %5C %0A#   %5C V / %7C %7C %7C  %7C %7C_%7C %7C (_) %7C%0A#    %5C_/  %7C_%7C_%7C   %5C____%7C%5C___/ %0A#                            %0A# Some syntax sugar for virgo%0A#%0A%0A%0Afrom virgo import *%0A%0A%0A# Model%5Bindex%5D%0A# e.g. user = User%5B2%5D%0A%0AMetaModel.__getitem__ = lambda model, index: model.at(index).select().fetchone()%0A%0A%0A# Model%5Bstart, end%5D%0A# e.g. users = User%5B1:3%5D%0A# note:change this after between implement%0A%0Adef getslice(model, start, end):%0A    %22%22%22Model%5Bstart, end%5D %0A    e.g. users = User%5B1:3%5D%0A    Produce: select * from user where user.id %3E= start and user.id  %3C= end%0A    %22%22%22%0A    exprs = %5B%5D%0A%0A    if start:%0A        exprs.append(model.primarykey %3E= start)%0A    if end:%0A        exprs.append(model.primarykey %3C= end)%0A    return model.where(*exprs).select().fetchall()%0A%0AMetaModel.__getslice__ = getslice%0A

add some syntax sugar getitem:User[id] getslice:User[id1:id2]