Commits

Jon Molesa committed bd6d40a

initial commit

Comments (0)

Files changed (89)

+Write something about this app.
+Developed with web2py.
+The web2py welcome app is licensed under public domain 
+(except for the css and js files that it includes, which have their own third party licenses).
+
+You can modify this license when you add your own code.

__init__.pyc

Binary file added.

controllers/appadmin.py

+# -*- coding: utf-8 -*-
+
+# ##########################################################
+# ## make sure administrator is on localhost
+# ###########################################################
+
+import os
+import socket
+import datetime
+import copy
+import gluon.contenttype
+import gluon.fileutils
+
+response.subtitle = 'Database Administration (appadmin)'
+
+# ## critical --- make a copy of the environment
+
+global_env = copy.copy(globals())
+global_env['datetime'] = datetime
+
+http_host = request.env.http_host.split(':')[0]
+remote_addr = request.env.remote_addr
+try:
+    hosts = (http_host, socket.gethostname(),
+             socket.gethostbyname(http_host),
+             '::1', '127.0.0.1', '::ffff:127.0.0.1')
+except:
+    hosts = (http_host, )
+
+if request.env.http_x_forwarded_for or request.is_https:
+    session.secure()
+elif (remote_addr not in hosts) and (remote_addr != "127.0.0.1"):
+    raise HTTP(200, T('appadmin is disabled because insecure channel'))
+
+if (request.application == 'admin' and not session.authorized) or \
+        (request.application != 'admin' and not gluon.fileutils.check_credentials(request)):
+    redirect(URL('admin', 'default', 'index',
+                 vars=dict(send=URL(args=request.args, vars=request.vars))))
+
+ignore_rw = True
+response.view = 'appadmin.html'
+response.menu = [[T('design'), False, URL('admin', 'default', 'design',
+                 args=[request.application])], [T('db'), False,
+                 URL('index')], [T('state'), False,
+                 URL('state')], [T('cache'), False,
+                 URL('ccache')]]
+
+# ##########################################################
+# ## auxiliary functions
+# ###########################################################
+
+
+def get_databases(request):
+    dbs = {}
+    for (key, value) in global_env.items():
+        cond = False
+        try:
+            cond = isinstance(value, GQLDB)
+        except:
+            cond = isinstance(value, SQLDB)
+        if cond:
+            dbs[key] = value
+    return dbs
+
+
+databases = get_databases(None)
+
+
+def eval_in_global_env(text):
+    exec ('_ret=%s' % text, {}, global_env)
+    return global_env['_ret']
+
+
+def get_database(request):
+    if request.args and request.args[0] in databases:
+        return eval_in_global_env(request.args[0])
+    else:
+        session.flash = T('invalid request')
+        redirect(URL('index'))
+
+
+def get_table(request):
+    db = get_database(request)
+    if len(request.args) > 1 and request.args[1] in db.tables:
+        return (db, request.args[1])
+    else:
+        session.flash = T('invalid request')
+        redirect(URL('index'))
+
+
+def get_query(request):
+    try:
+        return eval_in_global_env(request.vars.query)
+    except Exception:
+        return None
+
+
+def query_by_table_type(tablename, db, request=request):
+    keyed = hasattr(db[tablename], '_primarykey')
+    if keyed:
+        firstkey = db[tablename][db[tablename]._primarykey[0]]
+        cond = '>0'
+        if firstkey.type in ['string', 'text']:
+            cond = '!=""'
+        qry = '%s.%s.%s%s' % (
+            request.args[0], request.args[1], firstkey.name, cond)
+    else:
+        qry = '%s.%s.id>0' % tuple(request.args[:2])
+    return qry
+
+
+# ##########################################################
+# ## list all databases and tables
+# ###########################################################
+def index():
+    return dict(databases=databases)
+
+
+# ##########################################################
+# ## insert a new record
+# ###########################################################
+
+
+def insert():
+    (db, table) = get_table(request)
+    form = SQLFORM(db[table], ignore_rw=ignore_rw)
+    if form.accepts(request.vars, session):
+        response.flash = T('new record inserted')
+    return dict(form=form, table=db[table])
+
+
+# ##########################################################
+# ## list all records in table and insert new record
+# ###########################################################
+
+
+def download():
+    import os
+    db = get_database(request)
+    return response.download(request, db)
+
+
+def csv():
+    import gluon.contenttype
+    response.headers['Content-Type'] = \
+        gluon.contenttype.contenttype('.csv')
+    db = get_database(request)
+    query = get_query(request)
+    if not query:
+        return None
+    response.headers['Content-disposition'] = 'attachment; filename=%s_%s.csv'\
+        % tuple(request.vars.query.split('.')[:2])
+    return str(db(query, ignore_common_filters=True).select())
+
+
+def import_csv(table, file):
+    table.import_from_csv_file(file)
+
+
+def select():
+    import re
+    db = get_database(request)
+    dbname = request.args[0]
+    regex = re.compile('(?P<table>\w+)\.(?P<field>\w+)=(?P<value>\d+)')
+    if len(request.args) > 1 and hasattr(db[request.args[1]], '_primarykey'):
+        regex = re.compile('(?P<table>\w+)\.(?P<field>\w+)=(?P<value>.+)')
+    if request.vars.query:
+        match = regex.match(request.vars.query)
+        if match:
+            request.vars.query = '%s.%s.%s==%s' % (request.args[0],
+                                                   match.group('table'), match.group('field'),
+                                                   match.group('value'))
+    else:
+        request.vars.query = session.last_query
+    query = get_query(request)
+    if request.vars.start:
+        start = int(request.vars.start)
+    else:
+        start = 0
+    nrows = 0
+    stop = start + 100
+    table = None
+    rows = []
+    orderby = request.vars.orderby
+    if orderby:
+        orderby = dbname + '.' + orderby
+        if orderby == session.last_orderby:
+            if orderby[0] == '~':
+                orderby = orderby[1:]
+            else:
+                orderby = '~' + orderby
+    session.last_orderby = orderby
+    session.last_query = request.vars.query
+    form = FORM(TABLE(TR(T('Query:'), '', INPUT(_style='width:400px',
+                _name='query', _value=request.vars.query or '',
+                requires=IS_NOT_EMPTY(
+                    error_message=T("Cannot be empty")))), TR(T('Update:'),
+                INPUT(_name='update_check', _type='checkbox',
+                value=False), INPUT(_style='width:400px',
+                _name='update_fields', _value=request.vars.update_fields
+                                    or '')), TR(T('Delete:'), INPUT(_name='delete_check',
+                _class='delete', _type='checkbox', value=False), ''),
+                TR('', '', INPUT(_type='submit', _value=T('submit')))),
+                _action=URL(r=request, args=request.args))
+
+    tb = None
+    if form.accepts(request.vars, formname=None):
+        regex = re.compile(request.args[0] + '\.(?P<table>\w+)\..+')
+        match = regex.match(form.vars.query.strip())
+        if match:
+            table = match.group('table')
+        try:
+            nrows = db(query).count()
+            if form.vars.update_check and form.vars.update_fields:
+                db(query).update(**eval_in_global_env('dict(%s)'
+                                                      % form.vars.update_fields))
+                response.flash = T('%s %%{row} updated', nrows)
+            elif form.vars.delete_check:
+                db(query).delete()
+                response.flash = T('%s %%{row} deleted', nrows)
+            nrows = db(query).count()
+            if orderby:
+                rows = db(query, ignore_common_filters=True).select(limitby=(
+                    start, stop), orderby=eval_in_global_env(orderby))
+            else:
+                rows = db(query, ignore_common_filters=True).select(
+                    limitby=(start, stop))
+        except Exception, e:
+            import traceback
+            tb = traceback.format_exc()
+            (rows, nrows) = ([], 0)
+            response.flash = DIV(T('Invalid Query'), PRE(str(e)))
+    # begin handle upload csv
+    csv_table = table or request.vars.table
+    if csv_table:
+        formcsv = FORM(str(T('or import from csv file')) + " ",
+                       INPUT(_type='file', _name='csvfile'),
+                       INPUT(_type='hidden', _value=csv_table, _name='table'),
+                       INPUT(_type='submit', _value=T('import')))
+    else:
+        formcsv = None
+    if formcsv and formcsv.process().accepted:
+        try:
+            import_csv(db[request.vars.table],
+                       request.vars.csvfile.file)
+            response.flash = T('data uploaded')
+        except Exception, e:
+            response.flash = DIV(T('unable to parse csv file'), PRE(str(e)))
+    # end handle upload csv
+
+    return dict(
+        form=form,
+        table=table,
+        start=start,
+        stop=stop,
+        nrows=nrows,
+        rows=rows,
+        query=request.vars.query,
+        formcsv=formcsv,
+        tb=tb,
+    )
+
+
+# ##########################################################
+# ## edit delete one record
+# ###########################################################
+
+
+def update():
+    (db, table) = get_table(request)
+    keyed = hasattr(db[table], '_primarykey')
+    record = None
+    if keyed:
+        key = [f for f in request.vars if f in db[table]._primarykey]
+        if key:
+            record = db(db[table][key[0]] == request.vars[key[
+                        0]], ignore_common_filters=True).select().first()
+    else:
+        record = db(db[table].id == request.args(
+            2), ignore_common_filters=True).select().first()
+
+    if not record:
+        qry = query_by_table_type(table, db)
+        session.flash = T('record does not exist')
+        redirect(URL('select', args=request.args[:1],
+                     vars=dict(query=qry)))
+
+    if keyed:
+        for k in db[table]._primarykey:
+            db[table][k].writable = False
+
+    form = SQLFORM(
+        db[table], record, deletable=True, delete_label=T('Check to delete'),
+        ignore_rw=ignore_rw and not keyed,
+        linkto=URL('select',
+                   args=request.args[:1]), upload=URL(r=request,
+                                                      f='download', args=request.args[:1]))
+
+    if form.accepts(request.vars, session):
+        session.flash = T('done!')
+        qry = query_by_table_type(table, db)
+        redirect(URL('select', args=request.args[:1],
+                 vars=dict(query=qry)))
+    return dict(form=form, table=db[table])
+
+
+# ##########################################################
+# ## get global variables
+# ###########################################################
+
+
+def state():
+    return dict()
+
+
+def ccache():
+    form = FORM(
+        P(TAG.BUTTON(
+            T("Clear CACHE?"), _type="submit", _name="yes", _value="yes")),
+        P(TAG.BUTTON(
+            T("Clear RAM"), _type="submit", _name="ram", _value="ram")),
+        P(TAG.BUTTON(
+            T("Clear DISK"), _type="submit", _name="disk", _value="disk")),
+    )
+
+    if form.accepts(request.vars, session):
+        clear_ram = False
+        clear_disk = False
+        session.flash = ""
+        if request.vars.yes:
+            clear_ram = clear_disk = True
+        if request.vars.ram:
+            clear_ram = True
+        if request.vars.disk:
+            clear_disk = True
+
+        if clear_ram:
+            cache.ram.clear()
+            session.flash += T("Ram Cleared")
+        if clear_disk:
+            cache.disk.clear()
+            session.flash += T("Disk Cleared")
+
+        redirect(URL(r=request))
+
+    try:
+        from guppy import hpy
+        hp = hpy()
+    except ImportError:
+        hp = False
+
+    import shelve
+    import os
+    import copy
+    import time
+    import math
+    from gluon import portalocker
+
+    ram = {
+        'entries': 0,
+        'bytes': 0,
+        'objects': 0,
+        'hits': 0,
+        'misses': 0,
+        'ratio': 0,
+        'oldest': time.time(),
+        'keys': []
+    }
+    disk = copy.copy(ram)
+    total = copy.copy(ram)
+    disk['keys'] = []
+    total['keys'] = []
+
+    def GetInHMS(seconds):
+        hours = math.floor(seconds / 3600)
+        seconds -= hours * 3600
+        minutes = math.floor(seconds / 60)
+        seconds -= minutes * 60
+        seconds = math.floor(seconds)
+
+        return (hours, minutes, seconds)
+
+    for key, value in cache.ram.storage.items():
+        if isinstance(value, dict):
+            ram['hits'] = value['hit_total'] - value['misses']
+            ram['misses'] = value['misses']
+            try:
+                ram['ratio'] = ram['hits'] * 100 / value['hit_total']
+            except (KeyError, ZeroDivisionError):
+                ram['ratio'] = 0
+        else:
+            if hp:
+                ram['bytes'] += hp.iso(value[1]).size
+                ram['objects'] += hp.iso(value[1]).count
+            ram['entries'] += 1
+            if value[0] < ram['oldest']:
+                ram['oldest'] = value[0]
+            ram['keys'].append((key, GetInHMS(time.time() - value[0])))
+    folder = os.path.join(request.folder,'cache')
+    if not os.path.exists(folder):
+        os.mkdir(folder)
+    locker = open(os.path.join(folder, 'cache.lock'), 'a')
+    portalocker.lock(locker, portalocker.LOCK_EX)
+    disk_storage = shelve.open(
+        os.path.join(folder, 'cache.shelve'))
+    try:
+        for key, value in disk_storage.items():
+            if isinstance(value, dict):
+                disk['hits'] = value['hit_total'] - value['misses']
+                disk['misses'] = value['misses']
+                try:
+                    disk['ratio'] = disk['hits'] * 100 / value['hit_total']
+                except (KeyError, ZeroDivisionError):
+                    disk['ratio'] = 0
+            else:
+                if hp:
+                    disk['bytes'] += hp.iso(value[1]).size
+                    disk['objects'] += hp.iso(value[1]).count
+                disk['entries'] += 1
+                if value[0] < disk['oldest']:
+                    disk['oldest'] = value[0]
+                disk['keys'].append((key, GetInHMS(time.time() - value[0])))
+
+    finally:
+        portalocker.unlock(locker)
+        locker.close()
+        disk_storage.close()
+
+    total['entries'] = ram['entries'] + disk['entries']
+    total['bytes'] = ram['bytes'] + disk['bytes']
+    total['objects'] = ram['objects'] + disk['objects']
+    total['hits'] = ram['hits'] + disk['hits']
+    total['misses'] = ram['misses'] + disk['misses']
+    total['keys'] = ram['keys'] + disk['keys']
+    try:
+        total['ratio'] = total['hits'] * 100 / (total['hits'] +
+                                                total['misses'])
+    except (KeyError, ZeroDivisionError):
+        total['ratio'] = 0
+
+    if disk['oldest'] < ram['oldest']:
+        total['oldest'] = disk['oldest']
+    else:
+        total['oldest'] = ram['oldest']
+
+    ram['oldest'] = GetInHMS(time.time() - ram['oldest'])
+    disk['oldest'] = GetInHMS(time.time() - disk['oldest'])
+    total['oldest'] = GetInHMS(time.time() - total['oldest'])
+
+    def key_table(keys):
+        return TABLE(
+            TR(TD(B(T('Key'))), TD(B(T('Time in Cache (h:m:s)')))),
+            *[TR(TD(k[0]), TD('%02d:%02d:%02d' % k[1])) for k in keys],
+            **dict(_class='cache-keys',
+                   _style="border-collapse: separate; border-spacing: .5em;"))
+
+    ram['keys'] = key_table(ram['keys'])
+    disk['keys'] = key_table(disk['keys'])
+    total['keys'] = key_table(total['keys'])
+
+    return dict(form=form, total=total,
+                ram=ram, disk=disk, object_stats=hp != False)

controllers/default.py

+# -*- coding: utf-8 -*-
+### required - do no delete
+def user(): return dict(form=auth())
+def download(): return response.download(request,db)
+def call(): return service()
+### end requires
+def index():
+    return dict()
+
+def error():
+    return dict()
+
+@auth.requires_login()
+def challenges_manage():
+    form = SQLFORM.smartgrid(db.t_challenges,onupdate=auth.archive)
+    return locals()
+
+@auth.requires_login()
+def submissions_manage():
+    form = SQLFORM.smartgrid(db.t_submissions,onupdate=auth.archive)
+    return locals()
+
+#crontab

databases/c8b669d15150d7109e5f7ab36744a5b7_auth_cas.table

+(dp1
+S'user_id'
+p2
+(dp3
+S'length'
+p4
+I512
+sS'unique'
+p5
+I00
+sS'sortable'
+p6
+I2
+sS'sql'
+p7
+S'INTEGER REFERENCES auth_user (id) ON DELETE CASCADE'
+p8
+sS'notnull'
+p9
+I00
+sS'type'
+p10
+S'reference auth_user'
+p11
+ssS'service'
+p12
+(dp13
+g4
+I512
+sg5
+I00
+sg6
+I4
+sg7
+S'CHAR(512)'
+p14
+sg9
+I00
+sg10
+S'string'
+p15
+ssS'renew'
+p16
+(dp17
+g4
+I512
+sg5
+I00
+sg6
+I6
+sg7
+S'CHAR(1)'
+p18
+sg9
+I00
+sg10
+S'boolean'
+p19
+ssS'created_on'
+p20
+(dp21
+g4
+I512
+sg5
+I00
+sg6
+I3
+sg7
+S'TIMESTAMP'
+p22
+sg9
+I00
+sg10
+S'datetime'
+p23
+ssS'ticket'
+p24
+(dp25
+g4
+I512
+sg5
+I00
+sg6
+I5
+sg7
+S'CHAR(512)'
+p26
+sg9
+I00
+sg10
+g15
+ssS'id'
+p27
+(dp28
+g4
+I512
+sg5
+I00
+sg6
+I1
+sg7
+S'INTEGER PRIMARY KEY AUTOINCREMENT'
+p29
+sg9
+I00
+sg10
+g27
+ss.

databases/c8b669d15150d7109e5f7ab36744a5b7_auth_event.table

+(dp1
+S'origin'
+p2
+(dp3
+S'length'
+p4
+I512
+sS'unique'
+p5
+I00
+sS'sortable'
+p6
+I5
+sS'sql'
+p7
+S'CHAR(512)'
+p8
+sS'notnull'
+p9
+I00
+sS'type'
+p10
+S'string'
+p11
+ssS'client_ip'
+p12
+(dp13
+g4
+I512
+sg5
+I00
+sg6
+I3
+sg7
+S'CHAR(512)'
+p14
+sg9
+I00
+sg10
+g11
+ssS'user_id'
+p15
+(dp16
+g4
+I512
+sg5
+I00
+sg6
+I4
+sg7
+S'INTEGER REFERENCES auth_user (id) ON DELETE CASCADE'
+p17
+sg9
+I00
+sg10
+S'reference auth_user'
+p18
+ssS'description'
+p19
+(dp20
+g4
+I32768
+sg5
+I00
+sg6
+I6
+sg7
+S'TEXT'
+p21
+sg9
+I00
+sg10
+S'text'
+p22
+ssS'time_stamp'
+p23
+(dp24
+g4
+I512
+sg5
+I00
+sg6
+I2
+sg7
+S'TIMESTAMP'
+p25
+sg9
+I00
+sg10
+S'datetime'
+p26
+ssS'id'
+p27
+(dp28
+g4
+I512
+sg5
+I00
+sg6
+I1
+sg7
+S'INTEGER PRIMARY KEY AUTOINCREMENT'
+p29
+sg9
+I00
+sg10
+g27
+ss.

databases/c8b669d15150d7109e5f7ab36744a5b7_auth_group.table

+(dp1
+S'role'
+p2
+(dp3
+S'length'
+p4
+I512
+sS'unique'
+p5
+I00
+sS'sortable'
+p6
+I2
+sS'sql'
+p7
+S'CHAR(512)'
+p8
+sS'notnull'
+p9
+I00
+sS'type'
+p10
+S'string'
+p11
+ssS'id'
+p12
+(dp13
+g4
+I512
+sg5
+I00
+sg6
+I1
+sg7
+S'INTEGER PRIMARY KEY AUTOINCREMENT'
+p14
+sg9
+I00
+sg10
+g12
+ssS'description'
+p15
+(dp16
+g4
+I32768
+sg5
+I00
+sg6
+I3
+sg7
+S'TEXT'
+p17
+sg9
+I00
+sg10
+S'text'
+p18
+ss.

databases/c8b669d15150d7109e5f7ab36744a5b7_auth_membership.table

+(dp1
+S'group_id'
+p2
+(dp3
+S'length'
+p4
+I512
+sS'unique'
+p5
+I00
+sS'sortable'
+p6
+I3
+sS'sql'
+p7
+S'INTEGER REFERENCES auth_group (id) ON DELETE CASCADE'
+p8
+sS'notnull'
+p9
+I00
+sS'type'
+p10
+S'reference auth_group'
+p11
+ssS'user_id'
+p12
+(dp13
+g4
+I512
+sg5
+I00
+sg6
+I2
+sg7
+S'INTEGER REFERENCES auth_user (id) ON DELETE CASCADE'
+p14
+sg9
+I00
+sg10
+S'reference auth_user'
+p15
+ssS'id'
+p16
+(dp17
+g4
+I512
+sg5
+I00
+sg6
+I1
+sg7
+S'INTEGER PRIMARY KEY AUTOINCREMENT'
+p18
+sg9
+I00
+sg10
+g16
+ss.

databases/c8b669d15150d7109e5f7ab36744a5b7_auth_permission.table

+(dp1
+S'record_id'
+p2
+(dp3
+S'length'
+p4
+I512
+sS'unique'
+p5
+I00
+sS'sortable'
+p6
+I5
+sS'sql'
+p7
+S'INTEGER'
+p8
+sS'notnull'
+p9
+I00
+sS'type'
+p10
+S'integer'
+p11
+ssS'group_id'
+p12
+(dp13
+g4
+I512
+sg5
+I00
+sg6
+I2
+sg7
+S'INTEGER REFERENCES auth_group (id) ON DELETE CASCADE'
+p14
+sg9
+I00
+sg10
+S'reference auth_group'
+p15
+ssS'table_name'
+p16
+(dp17
+g4
+I512
+sg5
+I00
+sg6
+I4
+sg7
+S'CHAR(512)'
+p18
+sg9
+I00
+sg10
+S'string'
+p19
+ssS'id'
+p20
+(dp21
+g4
+I512
+sg5
+I00
+sg6
+I1
+sg7
+S'INTEGER PRIMARY KEY AUTOINCREMENT'
+p22
+sg9
+I00
+sg10
+g20
+ssS'name'
+p23
+(dp24
+g4
+I512
+sg5
+I00
+sg6
+I3
+sg7
+S'CHAR(512)'
+p25
+sg9
+I00
+sg10
+g19
+ss.

databases/c8b669d15150d7109e5f7ab36744a5b7_auth_user.table

+(dp1
+S'first_name'
+p2
+(dp3
+S'length'
+p4
+I128
+sS'unique'
+p5
+I00
+sS'sortable'
+p6
+I2
+sS'sql'
+p7
+S'CHAR(128)'
+p8
+sS'notnull'
+p9
+I00
+sS'type'
+p10
+S'string'
+p11
+ssS'last_name'
+p12
+(dp13
+g4
+I128
+sg5
+I00
+sg6
+I3
+sg7
+S'CHAR(128)'
+p14
+sg9
+I00
+sg10
+g11
+ssS'registration_id'
+p15
+(dp16
+g4
+I512
+sg5
+I00
+sg6
+I8
+sg7
+S'CHAR(512)'
+p17
+sg9
+I00
+sg10
+g11
+ssS'email'
+p18
+(dp19
+g4
+I512
+sg5
+I00
+sg6
+I4
+sg7
+S'CHAR(512)'
+p20
+sg9
+I00
+sg10
+g11
+ssS'reset_password_key'
+p21
+(dp22
+g4
+I512
+sg5
+I00
+sg6
+I7
+sg7
+S'CHAR(512)'
+p23
+sg9
+I00
+sg10
+g11
+ssS'password'
+p24
+(dp25
+g4
+I512
+sg5
+I00
+sg6
+I5
+sg7
+S'CHAR(512)'
+p26
+sg9
+I00
+sg10
+g24
+ssS'registration_key'
+p27
+(dp28
+g4
+I512
+sg5
+I00
+sg6
+I6
+sg7
+S'CHAR(512)'
+p29
+sg9
+I00
+sg10
+g11
+ssS'id'
+p30
+(dp31
+g4
+I512
+sg5
+I00
+sg6
+I1
+sg7
+S'INTEGER PRIMARY KEY AUTOINCREMENT'
+p32
+sg9
+I00
+sg10
+g30
+ss.

databases/c8b669d15150d7109e5f7ab36744a5b7_t_challenges.table

+(dp1
+S'f_description'
+p2
+(dp3
+S'length'
+p4
+I32768
+sS'unique'
+p5
+I00
+sS'sortable'
+p6
+I3
+sS'sql'
+p7
+S'TEXT'
+p8
+sS'notnull'
+p9
+I00
+sS'type'
+p10
+S'text'
+p11
+ssS'f_name'
+p12
+(dp13
+g4
+I512
+sg5
+I00
+sg6
+I2
+sg7
+S'CHAR(512)'
+p14
+sg9
+I00
+sg10
+S'string'
+p15
+ssS'is_active'
+p16
+(dp17
+g4
+I512
+sg5
+I00
+sg6
+I5
+sg7
+S'CHAR(1)'
+p18
+sg9
+I00
+sg10
+S'boolean'
+p19
+ssS'created_by'
+p20
+(dp21
+g4
+I512
+sg5
+I00
+sg6
+I7
+sg7
+S'INTEGER REFERENCES auth_user (id) ON DELETE CASCADE'
+p22
+sg9
+I00
+sg10
+S'reference auth_user'
+p23
+ssS'created_on'
+p24
+(dp25
+g4
+I512
+sg5
+I00
+sg6
+I6
+sg7
+S'TIMESTAMP'
+p26
+sg9
+I00
+sg10
+S'datetime'
+p27
+ssS'modified_on'
+p28
+(dp29
+g4
+I512
+sg5
+I00
+sg6
+I8
+sg7
+S'TIMESTAMP'
+p30
+sg9
+I00
+sg10
+g27
+ssS'modified_by'
+p31
+(dp32
+g4
+I512
+sg5
+I00
+sg6
+I9
+sg7
+S'INTEGER REFERENCES auth_user (id) ON DELETE CASCADE'
+p33
+sg9
+I00
+sg10
+g23
+ssS'f_solution'
+p34
+(dp35
+g4
+I512
+sg5
+I00
+sg6
+I4
+sg7
+S'CHAR(512)'
+p36
+sg9
+I00
+sg10
+g15
+ssS'id'
+p37
+(dp38
+g4
+I512
+sg5
+I00
+sg6
+I1
+sg7
+S'INTEGER PRIMARY KEY AUTOINCREMENT'
+p39
+sg9
+I00
+sg10
+g37
+ss.

databases/c8b669d15150d7109e5f7ab36744a5b7_t_challenges_archive.table

+(dp1
+S'f_description'
+p2
+(dp3
+S'length'
+p4
+I32768
+sS'unique'
+p5
+I00
+sS'sortable'
+p6
+I3
+sS'sql'
+p7
+S'TEXT'
+p8
+sS'notnull'
+p9
+I00
+sS'type'
+p10
+S'text'
+p11
+ssS'current_record'
+p12
+(dp13
+g4
+I512
+sg5
+I00
+sg6
+I10
+sg7
+S'INTEGER REFERENCES t_challenges (id) ON DELETE CASCADE'
+p14
+sg9
+I00
+sg10
+S'reference t_challenges'
+p15
+ssS'f_name'
+p16
+(dp17
+g4
+I512
+sg5
+I00
+sg6
+I2
+sg7
+S'CHAR(512)'
+p18
+sg9
+I00
+sg10
+S'string'
+p19
+ssS'is_active'
+p20
+(dp21
+g4
+I512
+sg5
+I00
+sg6
+I5
+sg7
+S'CHAR(1)'
+p22
+sg9
+I00
+sg10
+S'boolean'
+p23
+ssS'created_by'
+p24
+(dp25
+g4
+I512
+sg5
+I00
+sg6
+I7
+sg7
+S'INTEGER REFERENCES auth_user (id) ON DELETE CASCADE'
+p26
+sg9
+I00
+sg10
+S'reference auth_user'
+p27
+ssS'created_on'
+p28
+(dp29
+g4
+I512
+sg5
+I00
+sg6
+I6
+sg7
+S'TIMESTAMP'
+p30
+sg9
+I00
+sg10
+S'datetime'
+p31
+ssS'modified_on'
+p32
+(dp33
+g4
+I512
+sg5
+I00
+sg6
+I8
+sg7
+S'TIMESTAMP'
+p34
+sg9
+I00
+sg10
+g31
+ssS'modified_by'
+p35
+(dp36
+g4
+I512
+sg5
+I00
+sg6
+I9
+sg7
+S'INTEGER REFERENCES auth_user (id) ON DELETE CASCADE'
+p37
+sg9
+I00
+sg10
+g27
+ssS'f_solution'
+p38
+(dp39
+g4
+I512
+sg5
+I00
+sg6
+I4
+sg7
+S'CHAR(512)'
+p40
+sg9
+I00
+sg10
+g19
+ssS'id'
+p41
+(dp42
+g4
+I512
+sg5
+I00
+sg6
+I1
+sg7
+S'INTEGER PRIMARY KEY AUTOINCREMENT'
+p43
+sg9
+I00
+sg10
+g41
+ss.

databases/c8b669d15150d7109e5f7ab36744a5b7_t_submissions.table

+(dp1
+S'modified_by'
+p2
+(dp3
+S'length'
+p4
+I512
+sS'unique'
+p5
+I00
+sS'sortable'
+p6
+I7
+sS'sql'
+p7
+S'INTEGER REFERENCES auth_user (id) ON DELETE CASCADE'
+p8
+sS'notnull'
+p9
+I00
+sS'type'
+p10
+S'reference auth_user'
+p11
+ssS'is_active'
+p12
+(dp13
+g4
+I512
+sg5
+I00
+sg6
+I3
+sg7
+S'CHAR(1)'
+p14
+sg9
+I00
+sg10
+S'boolean'
+p15
+ssS'created_by'
+p16
+(dp17
+g4
+I512
+sg5
+I00
+sg6
+I5
+sg7
+S'INTEGER REFERENCES auth_user (id) ON DELETE CASCADE'
+p18
+sg9
+I00
+sg10
+g11
+ssS'created_on'
+p19
+(dp20
+g4
+I512
+sg5
+I00
+sg6
+I4
+sg7
+S'TIMESTAMP'
+p21
+sg9
+I00
+sg10
+S'datetime'
+p22
+ssS'modified_on'
+p23
+(dp24
+g4
+I512
+sg5
+I00
+sg6
+I6
+sg7
+S'TIMESTAMP'
+p25
+sg9
+I00
+sg10
+g22
+ssS'f_solution'
+p26
+(dp27
+g4
+I512
+sg5
+I00
+sg6
+I2
+sg7
+S'CHAR(512)'
+p28
+sg9
+I00
+sg10
+S'string'
+p29
+ssS'id'
+p30
+(dp31
+g4
+I512
+sg5
+I00
+sg6
+I1
+sg7
+S'INTEGER PRIMARY KEY AUTOINCREMENT'
+p32
+sg9
+I00
+sg10
+g30
+ss.

databases/c8b669d15150d7109e5f7ab36744a5b7_t_submissions_archive.table

+(dp1
+S'modified_by'
+p2
+(dp3
+S'length'
+p4
+I512
+sS'unique'
+p5
+I00
+sS'sortable'
+p6
+I7
+sS'sql'
+p7
+S'INTEGER REFERENCES auth_user (id) ON DELETE CASCADE'
+p8
+sS'notnull'
+p9
+I00
+sS'type'
+p10
+S'reference auth_user'
+p11
+ssS'current_record'
+p12
+(dp13
+g4
+I512
+sg5
+I00
+sg6
+I8
+sg7
+S'INTEGER REFERENCES t_submissions (id) ON DELETE CASCADE'
+p14
+sg9
+I00
+sg10
+S'reference t_submissions'
+p15
+ssS'is_active'
+p16
+(dp17
+g4
+I512
+sg5
+I00
+sg6
+I3
+sg7
+S'CHAR(1)'
+p18
+sg9
+I00
+sg10
+S'boolean'
+p19
+ssS'created_by'
+p20
+(dp21
+g4
+I512
+sg5
+I00
+sg6
+I5
+sg7
+S'INTEGER REFERENCES auth_user (id) ON DELETE CASCADE'
+p22
+sg9
+I00
+sg10
+g11
+ssS'created_on'
+p23
+(dp24
+g4
+I512
+sg5
+I00
+sg6
+I4
+sg7
+S'TIMESTAMP'
+p25
+sg9
+I00
+sg10
+S'datetime'
+p26
+ssS'modified_on'
+p27
+(dp28
+g4
+I512
+sg5
+I00
+sg6
+I6
+sg7
+S'TIMESTAMP'
+p29
+sg9
+I00
+sg10
+g26
+ssS'f_solution'
+p30
+(dp31
+g4
+I512
+sg5
+I00
+sg6
+I2
+sg7
+S'CHAR(512)'
+p32
+sg9
+I00
+sg10
+S'string'
+p33
+ssS'id'
+p34
+(dp35
+g4
+I512
+sg5
+I00
+sg6
+I1
+sg7
+S'INTEGER PRIMARY KEY AUTOINCREMENT'
+p36
+sg9
+I00
+sg10
+g34
+ss.
+timestamp: 2013-04-18T22:26:01.479878
+CREATE TABLE auth_user(
+    id INTEGER PRIMARY KEY AUTOINCREMENT,
+    first_name CHAR(128),
+    last_name CHAR(128),
+    email CHAR(512),
+    password CHAR(512),
+    registration_key CHAR(512),
+    reset_password_key CHAR(512),
+    registration_id CHAR(512)
+);
+success!
+timestamp: 2013-04-18T22:26:02.889653
+CREATE TABLE auth_group(
+    id INTEGER PRIMARY KEY AUTOINCREMENT,
+    role CHAR(512),
+    description TEXT
+);
+success!
+timestamp: 2013-04-18T22:26:03.281154
+CREATE TABLE auth_membership(
+    id INTEGER PRIMARY KEY AUTOINCREMENT,
+    user_id INTEGER REFERENCES auth_user (id) ON DELETE CASCADE,
+    group_id INTEGER REFERENCES auth_group (id) ON DELETE CASCADE
+);
+success!
+timestamp: 2013-04-18T22:26:03.500570
+CREATE TABLE auth_permission(
+    id INTEGER PRIMARY KEY AUTOINCREMENT,
+    group_id INTEGER REFERENCES auth_group (id) ON DELETE CASCADE,
+    name CHAR(512),
+    table_name CHAR(512),
+    record_id INTEGER
+);
+success!
+timestamp: 2013-04-18T22:26:03.726853
+CREATE TABLE auth_event(
+    id INTEGER PRIMARY KEY AUTOINCREMENT,
+    time_stamp TIMESTAMP,
+    client_ip CHAR(512),
+    user_id INTEGER REFERENCES auth_user (id) ON DELETE CASCADE,
+    origin CHAR(512),
+    description TEXT
+);
+success!
+timestamp: 2013-04-18T22:26:04.078969
+CREATE TABLE auth_cas(
+    id INTEGER PRIMARY KEY AUTOINCREMENT,
+    user_id INTEGER REFERENCES auth_user (id) ON DELETE CASCADE,
+    created_on TIMESTAMP,
+    service CHAR(512),
+    ticket CHAR(512),
+    renew CHAR(1)
+);
+success!
+timestamp: 2013-04-18T22:26:04.402929
+CREATE TABLE t_challenges(
+    id INTEGER PRIMARY KEY AUTOINCREMENT,
+    f_name CHAR(512),
+    f_description TEXT,
+    f_solution CHAR(512),
+    is_active CHAR(1),
+    created_on TIMESTAMP,
+    created_by INTEGER REFERENCES auth_user (id) ON DELETE CASCADE,
+    modified_on TIMESTAMP,
+    modified_by INTEGER REFERENCES auth_user (id) ON DELETE CASCADE
+);
+success!
+timestamp: 2013-04-18T22:26:04.699170
+CREATE TABLE t_challenges_archive(
+    id INTEGER PRIMARY KEY AUTOINCREMENT,
+    f_name CHAR(512),
+    f_description TEXT,
+    f_solution CHAR(512),
+    is_active CHAR(1),
+    created_on TIMESTAMP,
+    created_by INTEGER REFERENCES auth_user (id) ON DELETE CASCADE,
+    modified_on TIMESTAMP,
+    modified_by INTEGER REFERENCES auth_user (id) ON DELETE CASCADE,
+    current_record INTEGER REFERENCES t_challenges (id) ON DELETE CASCADE
+);
+success!
+timestamp: 2013-04-18T22:26:05.112137
+CREATE TABLE t_submissions(
+    id INTEGER PRIMARY KEY AUTOINCREMENT,
+    f_solution CHAR(512),
+    is_active CHAR(1),
+    created_on TIMESTAMP,
+    created_by INTEGER REFERENCES auth_user (id) ON DELETE CASCADE,
+    modified_on TIMESTAMP,
+    modified_by INTEGER REFERENCES auth_user (id) ON DELETE CASCADE
+);
+success!
+timestamp: 2013-04-18T22:26:05.546676
+CREATE TABLE t_submissions_archive(
+    id INTEGER PRIMARY KEY AUTOINCREMENT,
+    f_solution CHAR(512),
+    is_active CHAR(1),
+    created_on TIMESTAMP,
+    created_by INTEGER REFERENCES auth_user (id) ON DELETE CASCADE,
+    modified_on TIMESTAMP,
+    modified_by INTEGER REFERENCES auth_user (id) ON DELETE CASCADE,
+    current_record INTEGER REFERENCES t_submissions (id) ON DELETE CASCADE
+);
+success!

databases/storage.sqlite

Binary file added.
+# coding: utf8
+{
+'!langcode!': 'cs-cz',
+'!langname!': 'Český',
+'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" je voliteľný výraz ako "field1=\'newvalue\'". Nemôžete upravovať alebo zmazať výsledky JOINu',
+'%s %%{row} deleted': '%s zmazaných záznamů',
+'%s %%{row} updated': '%s upravených záznamů',
+'%s selected': '%s označených',
+'%Y-%m-%d': '%d.%m.%Y',
+'%Y-%m-%d %H:%M:%S': '%d.%m.%Y %H:%M:%S',
+'About': 'About',
+'Access Control': 'Access Control',
+'Administrative Interface': 'Administrative Interface',
+'Administrative interface': 'pro administrátorské rozhranie kliknite sem',
+'Ajax Recipes': 'Ajax Recipes',
+'appadmin is disabled because insecure channel': 'appadmin je zakázaný bez zabezpečeného spojení',
+'Are you sure you want to delete this object?': 'Opravdu chceš odstranit tento objekt?',
+'Available Databases and Tables': 'Dostupné databáze a tabuľky',
+'Buy this book': 'Buy this book',
+'cache': 'cache',
+'Cache': 'Cache',
+'Cache Keys': 'Cache Keys',
+'Cannot be empty': 'Nemůže být prázdné',
+'Change password': 'Změna hesla',
+'Check to delete': 'Označit ke smazání',
+'Check to delete:': 'Check to delete:',
+'Clear CACHE?': 'Clear CACHE?',
+'Clear DISK': 'Clear DISK',
+'Clear RAM': 'Clear RAM',
+'Client IP': 'Client IP',
+'Community': 'Community',
+'Components and Plugins': 'Components and Plugins',
+'Controller': 'Controller',
+'Copyright': 'Copyright',
+'Current request': 'Aktuální požadavek',
+'Current response': 'Aktuální odpověď',
+'Current session': 'Aktuální session',
+'customize me!': 'uprav mě!',
+'data uploaded': 'data nahrána',
+'Database': 'databáze',
+'Database %s select': 'databáze %s výber',
+'db': 'db',
+'DB Model': 'DB Model',
+'Delete:': 'Smazat:',
+'Demo': 'Demo',
+'Deployment Recipes': 'Deployment Recipes',
+'Description': 'Popis',
+'design': 'návrh',
+'DISK': 'DISK',
+'Disk Cache Keys': 'Disk Cache Keys',
+'Disk Cleared': 'Disk Cleared',
+'Documentation': 'Dokumentáce',
+"Don't know what to do?": "Don't know what to do?",
+'done!': 'hotovo!',
+'Download': 'Download',
+'E-mail': 'E-mail',
+'Edit': 'Upravit',
+'Edit current record': 'Upravit aktuální záznam',
+'Edit Profile': 'Upravit profil',
+'Email and SMS': 'Email and SMS',
+'enter a number between %(min)g and %(max)g': 'zadej číslo mezi %(min)g a %(max)g',
+'enter an integer between %(min)g and %(max)g': 'zadej celé číslo mezi %(min)g a %(max)g',
+'Errors': 'Errors',
+'export as csv file': 'exportovat do csv souboru',
+'FAQ': 'FAQ',
+'First name': 'Křestní jméno',
+'forgot username?': 'neznáš svúj nick?',
+'Forms and Validators': 'Forms and Validators',
+'Free Applications': 'Free Applications',
+'Group %(group_id)s created': 'Skupina %(group_id)s vytvořena',
+'Group ID': 'ID skupiny',
+'Groups': 'Groups',
+'Hello World': 'Ahoj světe',
+'Home': 'Home',
+'How did you get here?': 'How did you get here?',
+'import': 'import',
+'Import/Export': 'Import/Export',
+'Index': 'Index',