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

All Samples(12)  |  Call(6)  |  Derive(0)  |  Import(6)

src/l/a/Lampost-Mud-HEAD/lampost/gameops/template.py   Lampost-Mud(Download)
from lampost.datastore.classes import set_dbo_class, get_dbo_class
from lampost.context.resource import m_requires
from lampost.datastore.auto import TemplateField
from lampost.datastore.dbo import DBOField, RootDBO, RootDBOMeta
 
 
        if template_id:
            template_cls = get_dbo_class(template_id)
            template_cls.add_dbo_fields({name: dbo_field for name, dbo_field in cls.dbo_fields.viewitems() if isinstance(dbo_field, TemplateField)})
            template_cls.instance_cls = cls

src/l/a/Lampost-Mud-HEAD/lampost/datastore/dbconn.py   Lampost-Mud(Download)
from collections import defaultdict
from weakref import WeakValueDictionary
from redis import ConnectionPool
from redis.client import StrictRedis
from lampost.datastore.classes import get_dbo_class
    def create_object(self, dbo_class, dbo_dict):
        dbo_class = get_dbo_class(dbo_dict.get('sub_class_id', dbo_class.dbo_key_type))
        dbo_id = dbo_dict['dbo_id']
        if self.object_exists(dbo_class.dbo_key_type, dbo_id):
            raise ObjectExistsError(dbo_id)
            return None
        dbo_dict = json_decode(json_str)
        dbo_cls = get_dbo_class(dbo_dict.get('sub_class_id', key_type))
        dbo = dbo_cls(key)
        self._object_map[dbo.dbo_key] = dbo
            self.redis.srem(dbo.dbo_set_key, dbo.dbo_id)
        for children_type in dbo.dbo_children_types:
            self.delete_object_set(get_dbo_class(children_type), "{}_{}s:{}".format(dbo.dbo_key_type, children_type, dbo.dbo_id))
        for ix_name in dbo.dbo_indexes:
            ix_value = getattr(dbo, ix_name, None)

src/l/a/Lampost-Mud-HEAD/lampost/datastore/dbo.py   Lampost-Mud(Download)
from lampost.datastore.classes import set_dbo_class, get_dbo_class, add_sub_class
from lampost.context.resource import m_requires
from lampost.datastore.auto import AutoMeta, TemplateField, AutoField
 
m_requires('log', 'datastore', __name__)
    def _dbo_class(self):
        return get_dbo_class(self.dbo_class_id)
 
    def dbo_dto_value(self, dbo_value):
        return self._dbo_class().to_dto_repr(dbo_value)

src/l/a/Lampost-Mud-HEAD/lampost/env/feature.py   Lampost-Mud(Download)
from lampost.datastore.classes import get_dbo_class
from lampost.context.resource import m_requires
from lampost.datastore.dbo import DBOField
from lampost.gameops.script import Scriptable
from lampost.model.item import BaseItem
    def load_ref(cls, dbo_repr, owner=None):
        try:
            feature_cls = get_dbo_class(dbo_repr['sub_class_id'])
        except KeyError:
            error("Feature missing subclass id {} in room {}".format(dbo_repr, owner.dbo_id))

src/l/a/Lampost-Mud-HEAD/lampost/editor/editor.py   Lampost-Mud(Download)
import copy
 
from twisted.web.resource import Resource
from lampost.client.resources import request
from lampost.datastore.classes import get_sub_classes, get_dbo_class

src/l/a/Lampost-Mud-HEAD/lampost/editor/areas.py   Lampost-Mud(Download)
from twisted.web.resource import Resource
from lampost.client.resources import request
from lampost.datastore.classes import get_dbo_class
from lampost.context.resource import m_requires
from lampost.datastore.exceptions import DataError