Distinct database reference types (``type_``) in :class:`.models.DbReference`

        :return: List of strings for all available database cross reference types used in model DbReference
        :rtype: list[str]
333185
def dbreference_types(self):
        
        q = self.session.query(distinct(models.DbReference.type_))
        return [x[0] for x in q.all()]
464388
def foreign_keys(self):
        
        foreign_keys = self.__current_descriptor.get('foreignKeys', [])
        for key in foreign_keys:
            key.setdefault('fields', [])
            key.setdefault('reference', {})
            key['reference'].setdefault('resource', '')
            key['reference'].setdefault('fields', [])
            if not isinstance(key['fields'], list):
                key['fields'] = [key['fields']]
            if not isinstance(key['reference']['fields'], list):
                key['reference']['fields'] = [key['reference']['fields']]
        return foreign_keys
1110896
def _cachedSqlType(cls):
        
        if not hasattr(cls, "_cached_sql_type"):
            cls._cached_sql_type = cls.sqlType()
        return cls._cached_sql_type
190860
public String ofDbType( String dbSpecificType ) {
        if (dbSpecificType.equals(TEXT())) {
            return COMPAT_TEXT;
        } else if (dbSpecificType.equals(INTEGER())) {
            return COMPAT_INT;
        } else if (dbSpecificType.equals(LONG())) {
            return COMPAT_LONG;
        } else if (dbSpecificType.equals(REAL())) {
            return COMPAT_REAL;
        } else if (dbSpecificType.equals(BLOB())) {
            return COMPAT_BLOB;
        } else if (dbSpecificType.equals(CLOB())) {
            return COMPAT_CLOB;
        }
        throw new RuntimeException("No type for name: " + dbSpecificType);
    }
1036156
def referenced_vertices(self):
        
        # no entities no reference
        if len(self.entities) == 0:
            return np.array([], dtype=np.int64)
        referenced = np.concatenate([e.points for e in self.entities])
        referenced = np.unique(referenced.astype(np.int64))

        return referenced
393162
def get_orm_classes_by_table_name_from_base(base: Type) -> Dict[str, Type]:
    
    # noinspection PyUnresolvedReferences
    return {cls.__tablename__: cls for cls in gen_orm_classes_from_base(base)}
226466
def _get_dbal_column_type(self, type_):
        
        type_ = type_.lower()

        if type_ == "enum":
            return "string"

        return super(SQLiteSchemaGrammar, self)._get_dbal_column_type(type_)
77876
def column_types(self):
        
        column_types = {}
        for c in self.sqla_columns:
            column_types[c.name] = c.type
        return column_types
1263408
def get_referenced_fields_and_fragment_names(
    context: ValidationContext,
    cached_fields_and_fragment_names: Dict,
    fragment: FragmentDefinitionNode,
) -> Tuple[NodeAndDefCollection, List[str]]:
    
    # Short-circuit building a type from the node if possible.
    cached = cached_fields_and_fragment_names.get(fragment.selection_set)
    if cached:
        return cached

    fragment_type = type_from_ast(context.schema, fragment.type_condition)
    return get_fields_and_fragment_names(
        context, cached_fields_and_fragment_names, fragment_type, fragment.selection_set
    )
532265
def basic_types(self):
        
        if not self.foreign_key_definitions:
            return self.standard_types
        else:
            tmp = self.standard_types
            tmp.append('ForeignKey')
            return tmp
140982
def get_reference_templates(self, ref_types):
        """"""
        return OrderedDict([(x, self.get_reference_template(x)) for x in ref_types])
666168
def types(self):
        
        data = clips.data.DataObject(self._env)

        lib.EnvDeftemplateSlotTypes(
            self._env, self._tpl, self._name, data.byref)

        return tuple(data.value) if isinstance(data.value, list) else ()
553820
def database_all(self):
        
        all = {}
        for engine in self.engines():
            all[engine] = self._database_all(engine)
        return all
257759
def models_with_unique_column(meta, exclude_single_pk=True, exclude_multi_pk=True):
    """"""
    models_with_potential_pk = {}
    fields_distinct = {}
    for model_name, model_fields in meta.iteritems():
        if exclude_single_pk and model_fields['Meta']['primary_key']:
                continue
        fields_distinct = []
        for field_name, field in model_fields.iteritems():
            if field_name is 'Meta':
                continue
            if float(field.get('fraction_distinct', 0)) == 1.:
                fields_distinct += [field_name]
        # if any(not field['primary_key'] and field['num_distinct'] == 1 for field_name, field in model_fields.iteritems() if field is not 'Meta'):
        if (not exclude_multi_pk and fields_distinct) or len(fields_distinct) == 1:
            models_with_potential_pk[model_name] = fields_distinct
    return models_with_potential_pk
1187148
def get_reference_fields(self, exclude_models=None):
        
        if exclude_models is None:
            exclude_models = []
        result = []
        for django_model in django.apps.apps.get_models():
            if any([issubclass(django_model, m) for m in exclude_models]):
                continue
            for django_field in django_model._meta.fields:
                if isinstance(django_field, models.ForeignKey) and django_field.related.to == Item:
                    result = [(m, f) for (m, f) in result if not issubclass(django_model, m)]
                    result.append((django_model, django_field))
        return result
395487
def citations(self):
        

        if hasattr(self, 'citedReferences'):
            return [cr.ayjid for cr in self.citedReferences if cr is not None]
        return []
867430
def publictypes(self):
        
        for t in self.wsdl.schema.types.values():
            if t in self.params: continue
            if t in self.types: continue
            item = (t, t)
            self.types.append(item)
        tc = lambda x,y: cmp(x[0].name, y[0].name)
        self.types.sort(cmp=tc)