Skip to content

Commit

Permalink
rename __field_name__ to __field__
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Oct 5, 2011
1 parent 428c435 commit b16aa46
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions memphis/form/field.py
Expand Up @@ -33,7 +33,7 @@ def registerField(cls, name, layer=''):

def registerFieldImpl(cls, name):
fields[name] = cls
cls.__field_name__ = name
cls.__field__ = name


def getField(name):
Expand Down Expand Up @@ -179,7 +179,7 @@ def as_dict(self):
class Field(object):
"""Widget base class."""

__field_name__ = ''
__field__ = ''

name = ''
title = u''
Expand Down Expand Up @@ -348,18 +348,18 @@ def extract(self, default=null):

class FieldFactory(Field):

__field_name__ = ''
__field__ = ''

def __init__(self, typ, name, **kw):
self.__field_name__ = typ
self.__field__ = typ

super(FieldFactory, self).__init__(name, **kw)

def bind(self, prefix, content, params):
cls = getField(self.__field_name__)
cls = getField(self.__field__)
if cls is None:
raise TypeError(
"Can't find field implementation for '%s'"%cls.__field_name__)
"Can't find field implementation for '%s'"%cls.__field__)

clone = cls.__new__(cls)
clone.__dict__.update(self.__dict__)
Expand Down

0 comments on commit b16aa46

Please sign in to comment.