Example #1
0
def db_init_bookmark():
    """install the initial bookmark in a new install"""
    require('hosts', provided_by=[sample])
    require('ini', provided_by=[sample])

    parse_ini(env["ini_file"])
    from datetime import datetime
    import transaction
    from bookie.models import initialize_sql
    from sqlalchemy import create_engine

    engine = create_engine(env.ini.get('app:bookie', 'sqlalchemy.url'))
    initialize_sql(engine)

    from bookie.models import DBSession
    from bookie.models import Bmark

    bmark_us = Bmark(u'http://bmark.us',
                     u'admin',
                     desc=u"Bookie Website",
                     ext= u"Bookie Documentation Home",
                     tags = u"bookmarks")

    bmark_us.stored = datetime.now()
    bmark_us.updated = datetime.now()
    DBSession.add(bmark_us)
    DBSession.flush()
    transaction.commit()
Example #2
0
def upgrade(migrate_engine):
    """By default start all installs out with a bookmark to bmark.us

    It's cheesy, but helps with testing to have some base data and is good for
    pubbing the links

    """
    from datetime import datetime
    import transaction
    from bookie.models import initialize_sql

    initialize_sql(migrate_engine)

    from bookie.models import DBSession
    from bookie.models import Bmark

    bmark_us = Bmark('http://bmark.us',
                     desc="Bookie Website",
                     ext="Bookie Documentation Home",
                     tags="bookmarks")

    bmark_us.stored = datetime.now()
    bmark_us.updated = datetime.now()
    DBSession.add(bmark_us)
    DBSession.flush()
    transaction.commit()
def upgrade(migrate_engine):
    """By default start all installs out with a bookmark to bmark.us

    It's cheesy, but helps with testing to have some base data and is good for
    pubbing the links

    """
    from datetime import datetime
    import transaction
    from bookie.models import initialize_sql

    initialize_sql(migrate_engine)

    from bookie.models import DBSession
    from bookie.models import Bmark

    bmark_us = Bmark('http://bmark.us',
                     desc="Bookie Website",
                     ext= "Bookie Documentation Home",
                     tags = "bookmarks")

    bmark_us.stored = datetime.now()
    bmark_us.updated = datetime.now()
    DBSession.add(bmark_us)
    DBSession.flush()
    transaction.commit()
Example #4
0
    def _add_bmark(self):
        # setup the default bookie bookmark
        bmark_us = Bmark(u'http://bmark.us',
                         username=u"admin",
                         desc=u"Bookie Website",
                         ext=u"Bookie Documentation Home",
                         tags=u"bookmarks")

        bmark_us.stored = datetime.now()
        bmark_us.updated = datetime.now()
        transaction.commit()
Example #5
0
    def _add_bmark(self):
        # setup the default bookie bookmark
        bmark_us = Bmark(u'http://bmark.us',
                         username=u"admin",
                         desc=u"Bookie Website",
                         ext=u"Bookie Documentation Home",
                         tags=u"bookmarks")

        bmark_us.stored = datetime.now()
        bmark_us.updated = datetime.now()
        transaction.commit()
Example #6
0
    def _add_bmark_wt_desc(self):
        #setup the default google bookmark
        bmark_us = Bmark(u'http://google.com',
                         username=u"admin",
                         desc=u"",
                         ext=u"Google Search Engine",
                         tags=u"bookmarks")

        bmark_us.stored = datetime.now()
        bmark_us.updated = datetime.now()
        DBSession.add(bmark_us)
        transaction.commit()
Example #7
0
    def _add_bmark_wt_desc(self):
        #setup the default google bookmark
        bmark_us = Bmark(u'http://google.com',
                         username=u"admin",
                         desc=u"",
                         ext=u"Google Search Engine",
                         tags=u"bookmarks")

        bmark_us.stored = datetime.now()
        bmark_us.updated = datetime.now()
        DBSession.add(bmark_us)
        transaction.commit()
Example #8
0
    def _add_bmark(self):
        # setup the default bookie bookmark
        import logging
        log = logging.getLogger(__name__)
        log.error('called to add bmark')
        bmark_us = Bmark('http://bmark.us',
                         desc="Bookie Website",
                         ext= "Bookie Documentation Home",
                         tags = "bookmarks")

        bmark_us.stored = datetime.now()
        bmark_us.updated = datetime.now()
        DBSession.add(bmark_us)
        transaction.commit()
Example #9
0
    def _add_bmark(self):
        # setup the default bookie bookmark
        import logging
        log = logging.getLogger(__name__)
        log.error('called to add bmark')
        bmark_us = Bmark('http://bmark.us',
                         desc="Bookie Website",
                         ext="Bookie Documentation Home",
                         tags="bookmarks")

        bmark_us.stored = datetime.now()
        bmark_us.updated = datetime.now()
        DBSession.add(bmark_us)
        transaction.commit()
Example #10
0
from datetime import datetime
from ConfigParser import ConfigParser
from os import path

from bookie.models import initialize_sql


if __name__ == "__main__":
    ini = ConfigParser()
    ini_path = path.join(path.dirname(path.dirname(path.dirname(__file__))),
        'bookie.ini')

    ini.readfp(open(ini_path))
    initialize_sql(dict(ini.items("app:bookie")))

    from bookie.models import DBSession
    from bookie.models import Bmark

    bmark_us = Bmark(u'http://bmark.us',
                     u'admin',
                     desc=u'Bookie Website',
                     ext= u'Bookie Documentation Home',
                     tags = u'bookmarks')

    bmark_us.stored = datetime.now()
    bmark_us.updated = datetime.now()
    DBSession.add(bmark_us)
    DBSession.flush()
    transaction.commit()