Skip to content

Instantly share code, notes, and snippets.

@yonghanjung
Last active August 29, 2015 14:04
Show Gist options
  • Save yonghanjung/23d17e492789ea2b4907 to your computer and use it in GitHub Desktop.
Save yonghanjung/23d17e492789ea2b4907 to your computer and use it in GitHub Desktop.
멋쟁이사자 클래스
# Object-oriented programming intro
# Adapted from MIT 6.01 course notes (Section 3.5)
# http://mit.edu/6.01/mercurial/spring10/www/handouts/readings.pdf
class Staff601:
course = '6.01'
building = 34
room = 501
def salutation(self):
return self.role + ' ' + self.name
pat = Staff601()
print(pat.course)
pat.name = 'Pat'
pat.age = 60
pat.role = 'Professor'
print(pat.building)
pat.building = 32
print(pat.building)
print(pat.salutation())
print(Staff601.salutation(pat))
{% extends "layout.html" %}
{% block contents %}
<div class = "llArticleUpdate">
<form role = "form" method = "post">
{{ form.hidden_tag() }}
{% if form.errors %}
<div class = "alert alert-danger fade in">
<a class = "close" data-dismiss="alert" href="#">&times;</a>
{% for field, errors in form.errors.items() %}
<ul>
{% for error in errors %}
{{ error }}
{% endfor %}
</ul>
{% endfor %}
</div>
{% endif %}
{% from "_form_field.html" import render_field %}
{% for field in form if field.widget.input_type != 'hidden' %}
{{ render_field(field,class = "form-control") }}
{% endfor %}
<button type="submit" class = "btn btn-default">글 수정하기</button>
</form>
</div>
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment