pinnwand/command.py
def reap() -> None:
    """Delete all pastes that are past their expiry date in pinnwand's
       database."""
    with database.session() as session:
        pastes = (
            session.query(database.Paste)
            .filter(database.Paste.exp_date < datetime.now())
            .all()
        )

        for paste in pastes:
            session.delete(paste)

        session.commit()

        log.info("reap: removed %d pastes", len(pastes))
Delete all pastes that are past their expiry date in pinnwand's
       database.
Delete all pastes that are past their expiry date in pinnwand's
database.
Delete all pastes that are past their expiry date in pinnwand ' s database .
def reap() -> None:
    with database.session() as session:
        pastes = (
            session.query(database.Paste)
            .filter(database.Paste.exp_date < datetime.now())
            .all()
        )
        for paste in pastes:
            session.delete(paste)
        session.commit()
        log.info("reap: removed %d pastes", len(pastes))
def reap ( ) -> None : with database . session ( ) as session : pastes = ( session . query ( database . Paste ) . filter ( database . Paste . exp_date < datetime . now ( ) ) . all ( ) ) for paste in pastes : session . delete ( paste ) session . commit ( ) log . info ( "reap: removed %d pastes" , len ( pastes ) )
Delete all pastes that are past their expiry date in pinnwand's
database.
Delete all pastes that are past their expiry date in pinnwand ' s database .
"""Delete all pastes that are past their expiry date in pinnwand's
       database."""