معرفی شرکت ها


dolmen.field-0.3


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

Generic Formlib fields
ویژگی مقدار
سیستم عامل -
نام فایل dolmen.field-0.3
نام dolmen.field
نسخه کتابخانه 0.3
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Souheil Chelfouh
ایمیل نویسنده trollfot@gmail.com
آدرس صفحه اصلی http://gitweb.dolmen-project.org
آدرس اینترنتی https://pypi.org/project/dolmen.field/
مجوز GPL
============ dolmen.field ============ The `dolmen.field` package provides additional generic fields to extend `zope.schema`. Configuration fields ==================== The configuration fields are used for description and constraints, to impose a consistent schema and data model. GlobalClass ----------- `GlobalClass` is a field requiring a valid Interface class. It can be used for factories and other components that need to store an interface with the possibility to check and verify the consistency of the given value:: >>> from zope.interface import Interface >>> from dolmen.field import GlobalClass, IClassField >>> class IDummy(Interface): ... def shall_fail(): ... pass >>> class Dummy(object): ... pass Of course, it must be a valid interface:: >>> field = GlobalClass( ... title=u'a class field', ... schema=object ... ) Traceback (most recent call last): ... WrongType: <type 'object'> is not a valid Interface The interface will be used to validate the class:: >>> field = GlobalClass( ... title=u'a class field', ... schema=IDummy ... ) >>> field.schema <InterfaceClass dolmen.field.tests.IDummy> >>> IClassField.providedBy(field) True We make sure the `interface` attribute is not touched:: >>> print field.interface None In a first time, we make sure the class implements the needed interface:: >>> field._validate(Dummy) Traceback (most recent call last): ... ConstraintNotSatisfied: <class 'dolmen.field.tests.Dummy'> does not implement <InterfaceClass dolmen.field.tests.IDummy> >>> from zope.interface import classImplements >>> classImplements(Dummy, IDummy) >>> IDummy.implementedBy(Dummy) True Then the interface acts as a strict validator:: >>> field._validate(Dummy) Traceback (most recent call last): ... BrokenImplementation: An object has failed to implement interface <InterfaceClass dolmen.field.tests.IDummy> <BLANKLINE> The shall_fail attribute was not provided. <BLANKLINE> >>> Dummy.shall_fail = lambda x: u'not' >>> field._validate(Dummy) is None True Changelog ========= 0.3 (2009-10-25) ---------------- .. attention: This version is *not* compatible with the previous ones. * Refactored the field to use the 'schema' attribute instead of 'interface'. The attribute name 'interface' was conflicting with other fields manipulating packages. * Now using a README.txt instead of inline doctests, for more readability. 0.2 (2009-06-09) ---------------- * Initial Pypi release 0.1 (2009-05-03) ---------------- * Internal release


نحوه نصب


نصب پکیج whl dolmen.field-0.3:

    pip install dolmen.field-0.3.whl


نصب پکیج tar.gz dolmen.field-0.3:

    pip install dolmen.field-0.3.tar.gz