Registration form fields naming updated

darcs-hash:20070324105551-86b55-51c4f11ff6d916a867969c38090dbaad30e597ff.gz
This commit is contained in:
David Rousselie
2007-03-24 11:55:51 +01:00
parent 101e74f6c7
commit 289e1f2c36
4 changed files with 12 additions and 8 deletions

View File

@@ -765,8 +765,7 @@ class JCLComponent(Component, object):
# TODO : Add page when empty tuple given
pass
else:
lang_label_attr = _account_class.__name__.lower() \
+ "_" + field_name
lang_label_attr = "field_" + field_name
if hasattr(lang_class, lang_label_attr):
label = getattr(lang_class, lang_label_attr)
else:
@@ -778,8 +777,7 @@ class JCLComponent(Component, object):
value = default_func())
if field_options is not None:
for option_value in field_options:
lang_label_attr = _account_class.__name__.lower() \
+ "_" + field_name + "_" + option_value
lang_label_attr = "field_" + field_name + "_" + option_value
if hasattr(lang_class, lang_label_attr):
label = getattr(lang_class, lang_label_attr)
else:

View File

@@ -49,7 +49,7 @@ class FeederComponent(JCLComponent):
server, \
port, \
db_connection_str, \
lang)
lang = lang)
self.name = "Generic Feeder Component"
# Define default feeder and sender, can be override
self.feeder = Feeder(self)

View File

@@ -80,9 +80,14 @@ class Lang:
new_account_message_body = u"New account created"
mandatory_field = u"%s is required"
presence_action_0 = u"Do nothing"
presence_chat_action_0 = presence_action_0
field_action_0 = u"Do nothing"
field_chat_action_0 = field_action_0
field_online_action_0 = field_action_0
field_away_action_0 = field_action_0
field_xa_action_0 = field_action_0
field_dnd_action_0 = field_action_0
field_offline_action_0 = field_action_0
# account_login = u"Login"
# account_password = u"Password"
# account_password_store = u"Store password on Jabber server?"

View File

@@ -168,3 +168,4 @@ class PresenceAccount_TestCase(unittest.TestCase):
self.assertTrue(str(default_func()) in possibles_actions)
del account.hub.threadConnection
#TODO: test get_register_field with cls.possible_actions inheritance