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

All Samples(3)  |  Call(2)  |  Derive(0)  |  Import(1)
Ensure that the encoding status of all media is up to date with the new
set of enabled players.

The encoding status of Media objects is dependent on there being an
enabled player that supports that format. Call this method after changing
the set of enabled players, to ensure encoding statuses are up to date.

        def update_enabled_players():
    """Ensure that the encoding status of all media is up to date with the new
    set of enabled players.

    The encoding status of Media objects is dependent on there being an
    enabled player that supports that format. Call this method after changing
    the set of enabled players, to ensure encoding statuses are up to date.
    """
    from mediadrop.model import DBSession, Media
    media = DBSession.query(Media)
    for m in media:
        m.update_status()
        


src/m/e/mediadrop-HEAD/mediadrop/controllers/admin/players.py   mediadrop(Download)
from mediadrop.lib.decorators import autocommit, expose, observable, validate
from mediadrop.lib.helpers import redirect, url_for
from mediadrop.lib.players import update_enabled_players
from mediadrop.model import (DBSession, PlayerPrefs, fetch_row,
    cleanup_players_table)
        player = fetch_row(PlayerPrefs, id)
        player.enabled = True
        update_enabled_players()
        redirect(action='index', id=None)
 
        player = fetch_row(PlayerPrefs, id)
        player.enabled = False
        update_enabled_players()
        redirect(action='index', id=None)