# source_ports = forms.ModelMultipleChoiceField(queryset=MatchPort.objects.all(), help_text=ugettext_lazy("A set of source ports to block"), label=ugettext_lazy("Source Ports"), required=False)
# destination = forms.CharField(help_text=ugettext_lazy("A qualified IP Network address. CIDR notation,"
# destination_ports = forms.ModelMultipleChoiceField(queryset=MatchPort.objects.all(), help_text=ugettext_lazy("A set of destination ports to block"), label=ugettext_lazy("Destination Ports"), required=False)
# ports = forms.ModelMultipleChoiceField(queryset=MatchPort.objects.all(), help_text=ugettext_lazy("A set of ports to block"), label=ugettext_lazy("Ports"), required=False)
raiseforms.ValidationError('Cannot create rule for source ports and ports at the same time. Select either ports or source ports')
if(destinationportsandports):
raiseforms.ValidationError('Cannot create rule for destination ports and ports at the same time. Select either ports or destination ports')
ifsourceportsandnotsource:
raiseforms.ValidationError('Once source port is matched, source has to be filled as well. Either deselect source port or fill source address')
ifdestinationportsandnotdestination:
raiseforms.ValidationError('Once destination port is matched, destination has to be filled as well. Either deselect destination port or fill destination address')
<p>Give a short description of the intended use of this virtual machine, that justifies the parameter selection above. Feel free to include any additional comments.</p>
{% endblocktrans %}
<p>{{ form.comments }}
{% if form.errors %}<br/><spanclass="error">{{ form.comments.errors|join:", " }}</span>{% endif %}
</p>
<legend>{% trans "Route Match Conditions" %}</legend>
<legend>{% trans "Administrative contact" %}</legend>
{% blocktrans %}
<p>If you are applying on behalf of a NOC under GRNET's constituency, please select the appropriate organization. Otherwise, fill-in the admin contact information below.</p>
<li>You are solely responsible for the data on your VM. You have to take care of back-ups etc.</li>
<li>We reserve the right to temporarily suspend the operation of your VM in case it causes malfunctions to our infrastructure</li>
</ul>
<p>Give a short description of the intended use of this route, that justifies the parameter selection above. Feel free to include any additional comments.</p>
{% endblocktrans %}
<p>{{ form.accept_tos }} {% trans "I have read the above and accept them, along with the" %} <ahref="/about/terms-of-service/"target="_blank">{% trans "Terms of Service" %}</a></p>
{% if form.accept_tos.errors %}
<pclass="error">
{% trans "You must accept the terms of service before continuing." %}
<p>{{ form.comments }}
{% if form.errors %}<br/><spanclass="error">{{ form.comments.errors|join:", " }}</span>{% endif %}
</p>
{% endif %}
</fieldset>
<p><inputtype="submit"value="{% trans "Apply"%}"/></p>