def get_non_rares(self): # non-rare items in rare pages return Item.query.join(Location).filter( Item.rarity != "rare", Item.is_identified, *in_page_group("rare") )
def test_items(): """For displaying tests on a subset of items""" items = db.session.query( Item, db.func.count(Modifier.id), ).join(Location, Modifier).group_by( Item, Location.page_no, ).filter(Modifier.is_implicit == false(), Modifier.normalized.like("%Resist%"), *in_page_group("rare")).having( db.func.count(Modifier.normalized.like("%Resist%")) == 2, # ).order_by( # gem_cnt.desc() ).all() return render_template( 'list.html', title="Item Resists", items=[item for item, cnt in items], item_renderer="item_table", )
def get_items(self): low_attr_items = db.session.query( Item, db.func.count(Modifier.id), ).join(Modifier, Location).group_by( Item, Location.page_no, ).filter( Modifier.is_implicit == false(), # keep the 6 socket items # Item.num_sockets != 6, # item types we are not interested in # and_( # not_(Item.type.like('%Quiver%')), # not_(Item.type.like('%Belt%')), # not_(Item.type.like('%Sash%')), # ), # modifiers that we aren't interested in and_( not_(Modifier.normalized.like('%Light Radius%')), not_(Modifier.normalized.like('%Accuracy Rating%')), not_(Modifier.normalized.like('%Stun Recovery%')), not_(Modifier.normalized.like('%Reduced Attribute%')), ), *in_page_group("rare") ).having( db.func.count(Modifier.id) <= 4 ).order_by(Location.page_no, Item.type) # items = [] # for item, _ in low_attr_items: # # keep items with double resist mods # if sum(1 for m in item.mods if "Resist" in m.normalized) >= 2: # continue # items.append(item) # return items return [item for item, _ in low_attr_items]
def test_items(): """For displaying tests on a subset of items""" items = db.session.query( Item, db.func.count(Modifier.id), ).join(Location, Modifier).group_by( Item, Location.page_no, ).filter( Modifier.is_implicit == false(), Modifier.normalized.like("%Resist%"), *in_page_group("rare") ).having( db.func.count(Modifier.normalized.like("%Resist%")) == 2, # ).order_by( # gem_cnt.desc() ).all() return render_template( 'list.html', title="Item Resists", items=[item for item, cnt in items], item_renderer="item_table", )
def get_unidentified(self): # non-rare items in rare pages return Item.query.join(Location).filter(~Item.is_identified, *in_page_group("rare"))
def get_unidentified(self): # non-rare items in rare pages return Item.query.join(Location).filter( ~Item.is_identified, *in_page_group("rare") )