dispatch/theme/validators.py
def validate_widget(widget):
    """Checks that the given widget contains the required fields"""

    if not has_valid_id(widget):
        raise InvalidWidget("%s must contain a valid 'id' attribute" % widget.__name__)

    if not has_valid_name(widget):
        raise InvalidWidget("%s must contain a valid 'name' attribute" % widget.__name__)

    if not has_valid_template(widget):
        raise InvalidWidget("%s must contain a valid 'template' attribute" % widget.__name__)

    if not hasattr(widget, 'zones') or not widget.zones:
        raise InvalidWidget("%s must be compatible with at least one zone" % widget.__name__)
def validate_widget(widget):
    """Checks that the given widget contains the required fields"""

    if not has_valid_id(widget):
        raise InvalidWidget("%s must contain a valid 'id' attribute" % widget.__name__)

    if not has_valid_name(widget):
        raise InvalidWidget("%s must contain a valid 'name' attribute" % widget.__name__)

    if not has_valid_template(widget):
        raise InvalidWidget("%s must contain a valid 'template' attribute" % widget.__name__)

    if not hasattr(widget, 'zones') or not widget.zones:
        raise InvalidWidget("%s must be compatible with at least one zone" % widget.__name__)
Checks that the given widget contains the required fields