Created
October 1, 2012 10:22
-
-
Save ego008/3810745 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_newest(): | |
nid_obj = Counter.get_or_insert('node_auto_increment', name='node_auto_increment', value = 1) | |
from_id = nid_obj.value - 1 | |
to_id = from_id - 10 | |
if to_id<0: | |
to_id = 0 | |
objs = [] | |
n_objs = Node.get_by_id([id for id in range(from_id, to_id, -1)]) | |
for n_obj in n_objs: | |
if n_obj: | |
objs.append(('n-'+str(n_obj.key().id()), n_obj.name)) | |
return objs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment