Skip to content

Instantly share code, notes, and snippets.

View mintchaos's full-sized avatar

Christian Metts mintchaos

View GitHub Profile

#positivepython

The legendary #django-social channel was once a lovely place of vibrant, cheerful discussion. I miss that.

This experimental channel is a place for off-topic, positive conversation. IRC is a great place to bitch and vent, but #positivepython is not the place for it.

Feel free to invite anyone that you feel should be a part of the group. We want to be selective, not exclusive.

@register.filter
def exclude_fields(form, field_names):
"""
Returns the fields of a Form excluding the named fields. Usage:
{% for field in form|exclude_fields:"field1,field2,field3" %}
"""
fields = []
if isinstance(form, BaseForm):
field_names = field_names.split(',')
for field in form.fields: