Maybe something like the following untested code:
def submit_if_any(a, b, conditions, submit_func):
has_any = False
for condition in conditions:
if condition(a, b):
has_any = True
break
if has_any:
submit_func(a, b)
def submit(a, b):
a.email = b['email'],
a.is_active = b['is_active']
submit_if_any(
user,
request['POST'],
(
lambda a,b: a.email == b['email'],
lambda a,b: a.is_active == b['is_active'],
),
submit
)
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.