Return a dictionary of all attributes which will be/have been/are being
        stored in the database.
180926
def persistentValues(self):
        
        return dict((k, getattr(self, k)) for (k, attr) in self.getSchema())
1055708
def as_dict(self):
        
        self.clean()
        d = OrderedDict()
        all_props = self.__class__.CONFIG_PROPERTIES
        for attr_name, attr_config in six.iteritems(all_props):
            value = self._config[attr_name]
            attr_type = attr_config.attr_type
            if attr_type:
                if value:
                    if issubclass(attr_type, list):
                        if issubclass(attr_type, NamedTupleList):
                            d[attr_name] = [i._asdict() for i in value]
                        else:
                            d[attr_name] = value[:]
                    elif attr_type is dict:
                        d[attr_name] = dict(value)
            elif value is not NotSet:
                d[attr_name] = value
        return d
733610
def credentials(self):
        """"""
        if self.filename:
            db_filename = os.path.join(os.getcwd(), self.filename)
        else:
            db_filename = None

        return {
            "username": self.username,
            "password": self.password,
            "hostname": self.hostname,
            "port": self.port,
            "filename": db_filename,
            "dbname": self.dbname,
            "dbtype": self.dbtype,
            "schemas": self.schemas,
            "limit": self.limit,
            "keys_per_column": self.keys_per_column,
        }
282547
def AsDict(self, dt=True):
        
        data = {}

        if self.id:
            data['id'] = self.id
        if self.name:
            data['name'] = self.name
        if self.owner:
            data['owner'] = self.owner.AsDict()
        if self.url:
            data['url'] = self.url
        if self.thumbnail_url:
            data['thumbnail_url'] = self.thumbnail_url
        if self.description:
            data['description'] = self.description
        if self.type:
            data['type'] = self.type

        if dt:
            if self.created_at:
                data['created_at'] = self.created_at
            if self.updated_at:
                data['updated_at'] = self.updated_at
        else:
            if self.created_at:
                data['created_at'] = self.created_at_iso
            if self.updated_at:
                data['updated_at'] = self.updated_at_iso

        return data
1075016
def as_dict(self):
        """"""
        def conv(v):
            if isinstance(v, SerializableAttributesHolder):
                return v.as_dict()
            elif isinstance(v, list):
                return [conv(x) for x in v]
            elif isinstance(v, dict):
                return {x:conv(y) for (x,y) in v.items()}
            else:
                return v
        return {k.replace('_', '-'): conv(v) for (k, v) in self._attributes.items()}
787023
def _initialize_attributes(self, data):
    """"""
    attrs = dict(self.attrs)

    if self.primary_key_name is None:
      pass
    elif isinstance(self.primary_key_name, str):
      if self.primary_key_name not in attrs:
        attrs[self.primary_key_name] = None
    else:
      for pkey in self.primary_key_name:
        if pkey not in attrs:
          attrs[pkey] = None

    if self.timestamps:
      for ts_name in self.timestamps:
        if ts_name is not None and ts_name not in attrs:
          attrs[ts_name] = None

    for attr_name in attrs:
      setattr(self, attr_name, get_value(data, attr_name, attrs[attr_name]))
296215
def _get_record_attrs(out_keys):
    
    if len(out_keys) == 1:
        attr = list(out_keys.keys())[0]
        if out_keys[attr]:
            return attr, out_keys[attr]
    return None, None
368843
def data(self):
        
        d = {}
        for key in self._data:
            if key == "plugins":
                d[key] = self.plugins.data()
            else:
                try:
                    d[key] = getattr(self, key)
                except AttributeError:
                    pass  # unknown key, just leave it unchanged
        return d
1258200
def getEncodableAttributes(self, obj, **kwargs):
        
        attrs = pyamf.ClassAlias.getEncodableAttributes(self, obj, **kwargs)

        if not self.exclude_sa_key:
            # primary_key_from_instance actually changes obj.__dict__ if
            # primary key properties do not already exist in obj.__dict__
            attrs[self.KEY_ATTR] = self.mapper.primary_key_from_instance(obj)

        if not self.exclude_sa_lazy:
            lazy_attrs = []

            for attr in self.properties:
                if attr not in obj.__dict__:
                    lazy_attrs.append(attr)

            attrs[self.LAZY_ATTR] = lazy_attrs

        return attrs
692009
def getSchema(cls):
        
        schema = []
        for name, atr in cls.__attributes__:
            atr = atr.__get__(None, cls)
            if isinstance(atr, SQLAttribute):
                schema.append((name, atr))
        cls.getSchema = staticmethod(lambda schema=schema: schema)
        return schema
826179
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'synonym') and self.synonym is not None:
            _dict['synonym'] = self.synonym
        if hasattr(self, 'created') and self.created is not None:
            _dict['created'] = datetime_to_string(self.created)
        if hasattr(self, 'updated') and self.updated is not None:
            _dict['updated'] = datetime_to_string(self.updated)
        return _dict
75976
def to_dict(self):
        

        return {
            'current': self.current,
            'first': self.first,
            'last': self.last,
            'next': self.more,
            'prev': self.prev,
        }
593988
def attributes(atts = {}, for_definition = false)
      wrapped_attributes atts, for_definition
      attributes_assignments atts, false, for_definition
      atts
    end
648477
def simpleAttrs(self):
        """"""
        simpleAttrs = {}
        for k,v in iteritems(self.attrs):
            if k in ["_matches"]: continue # attributes to specifically ignore
            try:    simpleAttrs[k] = v.type
            except: simpleAttrs[k] = v
        return simpleAttrs
476355
def attributes(self):
        
        return dict([(name, getattr(self, name)) for (name, _) in self.format.values() if name is not None and not name.startswith('_')])
26012
def to_dict(self):
        
        if self._dict is not None:
            return self._dict

        result = {}
        for key in self.ATTRIBUTES:
            value = getattr(self, key)
            if value:
                result[key] = value
        self._dict = result
        return result
820730
def attributes(self):
        """"""
        attributes = {
            'name': self.name,
            'camera_id': self.camera_id,
            'serial': self.serial,
            'temperature': self.temperature,
            'temperature_c': self.temperature_c,
            'temperature_calibrated': self.temperature_calibrated,
            'battery': self.battery,
            'thumbnail': self.thumbnail,
            'video': self.clip,
            'motion_enabled': self.motion_enabled,
            'motion_detected': self.motion_detected,
            'wifi_strength': self.wifi_strength,
            'network_id': self.sync.network_id,
            'sync_module': self.sync.name,
            'last_record': self.last_record
        }
        return attributes