当前位置: 首页>>代码示例>>Python>>正文


Python modelsinspector.introspector函数代码示例

本文整理汇总了Python中south.modelsinspector.introspector函数的典型用法代码示例。如果您正苦于以下问题:Python introspector函数的具体用法?Python introspector怎么用?Python introspector使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了introspector函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: south_field_triple

 def south_field_triple(self):
     # Undo the softdep feature
     # Show as Plugin..Field in the migrations.
     from south.modelsinspector import introspector
     path = _get_path(self.__class__)
     args, kwargs = introspector(self)
     return (path, args, kwargs)
开发者ID:smithai,项目名称:django-fluent-contents,代码行数:7,代码来源:model_fields.py

示例2: south_field_triple

 def south_field_triple(self):
     "Returns a suitable description of this field for South."
     from south.modelsinspector import introspector
     field_class = "djangospot.utils.fields.SeparatedValuesField"
     args, kwargs = introspector(self)
     kwargs['token'] = repr(self.token)
     return (field_class, args, kwargs)
开发者ID:dcramer,项目名称:djangospot,代码行数:7,代码来源:__init__.py

示例3: south_field_triple

 def south_field_triple(self):
     ''''Returns a suitable description of this field for South.'''
     
     from south.modelsinspector import introspector
     args, kwargs = introspector(models.CharField)
     kwargs = dict(list(self.DEFAULT_KWARGS.items()) + list(kwargs.items()))
     return ('django.db.models.fields.CharField', args, kwargs)
开发者ID:gregplaysguitar,项目名称:django-locationpicker,代码行数:7,代码来源:location_picker.py

示例4: south_field_triple

    def south_field_triple(self):
        "Returns a suitable description of this field for South."
        from south.modelsinspector import introspector

        field_class = OneToOneField.__module__ + "." + OneToOneField.__name__
        args, kwargs = introspector(self)
        return (field_class, args, kwargs)
开发者ID:alonslotky,项目名称:universal_tutors,代码行数:7,代码来源:fields.py

示例5: south_field_triple

 def south_field_triple(self):
     "Returns a suitable description of this field for South."
     from south.modelsinspector import introspector
     field_class = self.__class__.__module__ + "." + self.__class__.__name__
     args, kwargs = introspector(self)
     # That's our definition!
     return (field_class, args, kwargs)
开发者ID:seedinvest,项目名称:django-cities-light-with-population,代码行数:7,代码来源:models.py

示例6: south_field_triple

    def south_field_triple(self):
        """Return a description of this field parsable by South."""

        # It's safe to import South at this point; this method
        # will never actually be called unless South is installed.
        from south.modelsinspector import introspector

        # Get the args and kwargs with which this field was generated.
        # The "double" variable name is a riff of of South "triples", since
        #   the `introspector` function only returns the final two elements
        #   of a South triple. This is fine since those two pieces are all
        #   we actually need.
        double = introspector(self.of)

        # Return the appropriate South triple.
        return (
            '%s.%s' % (self.__class__.__module__, self.__class__.__name__),
            [],
            {
                # The `of` argument is *itself* another triple, of
                #   the internal field.
                # The ArrayField constructor understands how to resurrect
                #   its internal field from this serialized state.
                'of': (
                    '{module}.{class_name}'.format(
                        module=self.of.__class__.__module__,
                        class_name=self.of.__class__.__name__,
                    ),
                    double[0],
                    double[1],
                ),
            },
        )
开发者ID:elbaschid,项目名称:django-pgfields,代码行数:33,代码来源:array.py

示例7: south_field_triple

 def south_field_triple(self):
     "Returns a suitable description of this field for South."
     # We'll just introspect ourselves, since we inherit.
     from south.modelsinspector import introspector
     field_class = "django.db.models.fields.DateTimeField"
     args, kwargs = introspector(self)
     return (field_class, args, kwargs)
开发者ID:sjlehtin,项目名称:django-extensions,代码行数:7,代码来源:__init__.py

示例8: south_field_triple

 def south_field_triple(self):
     """
     Describe the field to south for use in migrations.
     """
     from south.modelsinspector import introspector
     args, kwargs = introspector(self)
     return ("django.db.models.fields.TextField", args, kwargs)
开发者ID:brat002,项目名称:ebscab,代码行数:7,代码来源:fields.py

示例9: south_field_triple

 def south_field_triple(self):
     """Required for south to work.
     """
     from south.modelsinspector import introspector
     name = '%s.%s' % (self.__class__.__module__, self.__class__.__name__)
     args, kwargs = introspector(self)
     return name, args, kwargs
开发者ID:churchlab,项目名称:millstone,代码行数:7,代码来源:custom_fields.py

示例10: south_field_triple

 def south_field_triple(self):
     """Returns a suitable description of this field for South."""
     # We'll just introspect ourselves, since we inherit.
     from south.modelsinspector import introspector
     field_class = 'django.db.models.fields.related.ForeignKey'
     args, kwargs = introspector(self)
     return (field_class, args, kwargs)
开发者ID:JoshStegmaier,项目名称:djangocms-forms,代码行数:7,代码来源:fields.py

示例11: south_field_triple

    def south_field_triple(self):
        "Returns a suitable description of this field for South."
        from south.modelsinspector import introspector

        field_class = "django.db.models.fields.BigIntegerField"
        args, kwargs = introspector(self)
        return (field_class, args, kwargs)
开发者ID:NGFieldScope,项目名称:django-bitfield,代码行数:7,代码来源:models.py

示例12: south_field_triple

 def south_field_triple(self):
     """Return a suitable description for south."""
     from south.modelsinspector import introspector
     args, kwargs = introspector(self)
     del kwargs['max_length']
     kwargs['choices'] = [(key, key) for key in self.set_definition.choices]
     return ('extypes.django.SetField', args, kwargs)
开发者ID:xavfernandez,项目名称:extypes,代码行数:7,代码来源:django.py

示例13: south_field_triple

 def south_field_triple(self):
     'Returns a suitable description of this field for South.'
     # We'll just introspect ourselves, since we inherit.
     from south.modelsinspector import introspector
     fc = self.__class__
     field_class = '%s.%s' % (fc.__module__, fc.__name__)
     args, kwargs = introspector(self)
     return (field_class, args, kwargs)
开发者ID:vikingco,项目名称:cl_utils,代码行数:8,代码来源:datetime_fields.py

示例14: south_field_triple

 def south_field_triple(self):
     try:
         from south.modelsinspector import introspector
         cls_name = '{0}.{1}'.format(self.__class__.__module__, self.__class__.__name__)
         args, kwargs = introspector(self)
         return cls_name, args, kwargs
     except ImportError:
         pass
开发者ID:aleray,项目名称:django-admin-sortable,代码行数:8,代码来源:fields.py

示例15: south_field_triple

 def south_field_triple(self):
     """Returns a suitable description of this field for South."""
     # We'll just introspect the _actual_ field.
     from south.modelsinspector import introspector
     field_class = self._c_native.__class__.__module__ + "." + self._c_native.__class__.__name__
     args, kwargs = introspector(self._c_native)
     # That's our definition!
     return (field_class, args, kwargs)
开发者ID:netinsideout,项目名称:django-composition,代码行数:8,代码来源:base.py


注:本文中的south.modelsinspector.introspector函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。