Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)

src/m/e/mediadrop-HEAD/mediadrop/model/tags.py   mediadrop(Download)
        # Do a bulk insert to create the tag rows.
        new_tags = [{'name': n, 'slug': s} for s, n in uniques.iteritems()]
        DBSession.execute(tags.insert(), new_tags)
        DBSession.flush()
        # Query for our newly created rows and append them to our result set.

src/m/e/mediadrop-HEAD/mediadrop/model/players.py   mediadrop(Download)
    # fetch the players that are already in the database
    s = players.select().order_by('priority')
    existing_players_query = DBSession.execute(s)
    existing_player_rows = [p for p in existing_players_query]
    existing_player_names = [p['name'] for p in existing_player_rows]
                       .where(players.c.id == player_row['id'])\
                       .values(priority=priority)
            DBSession.execute(u)
 
    # Ensure that all available players are in the database
    for player_cls in all_players:
        if player_cls.name not in existing_player_names:
            enable_player = enabled and player_cls in default_players
            priority += 1
            DBSession.execute(players.insert().values(

src/m/e/mediadrop-HEAD/mediadrop/model/media.py   mediadrop(Download)
            return self.views
 
        DBSession.execute(media.update()\
            .values(views=media.c.views + 1)\
            .where(media.c.id == self.id))