Пример #1
0
    def load(cls, context, db_event=None, event_id=None):
        '''Retrieve an event record from database.'''
        if db_event is not None:
            return cls.from_db_record(db_event)

        record = db_api.event_get(context, event_id)
        if record is None:
            raise exception.EventNotFound(event=event_id)

        return cls.from_db_record(record)
Пример #2
0
    def load(cls, context, db_event=None, event_id=None, project_safe=True):
        """Retrieve an event record from database."""
        if db_event is not None:
            return cls.from_db_record(db_event)

        record = db_api.event_get(context, event_id, project_safe=project_safe)
        if record is None:
            raise exception.EventNotFound(event=event_id)

        return cls.from_db_record(record)
Пример #3
0
 def get(cls, context, event_id, **kwargs):
     return db_api.event_get(context, event_id, **kwargs)
Пример #4
0
 def get(cls, context, event_id, **kwargs):
     obj = db_api.event_get(context, event_id, **kwargs)
     return cls._from_db_object(context, cls(), obj)
Пример #5
0
 def get(cls, context, event_id, **kwargs):
     return db_api.event_get(context, event_id, **kwargs)