Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jbbarth
Last active May 28, 2018 08:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbbarth/abf578dd9fef06c93e28fd80b40733dc to your computer and use it in GitHub Desktop.
Save jbbarth/abf578dd9fef06c93e28fd80b40733dc to your computer and use it in GitHub Desktop.
<p>
{{ form.name.errors }}
<label for=id_name>Name:</label>
{{ form.name }}
</p>
<p>
{{ form.is_captain.errors }}
<label for=id_is_captain>Is Captain?:</label>
{% if user.name == "Alice" %}
<input type=checkbox name=is_captain id=id_is_captain {% if object.is_captain %}checked{% endif %}>
{% else %}
{{ object.is_captain|yesno:"Yes,No" }} <i>(must be admin to edit)</i>
{% endif %}
</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment