This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf.urls.defaults import * | |
# Uncomment the next two lines to enable the admin: | |
from django.contrib import admin | |
admin.autodiscover() | |
urlpatterns = patterns('', | |
# Example: | |
# (r'^project/', include('project.foo.urls')), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib import admin | |
from models import * | |
admin.site.register(Issue) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.forms import ModelForm | |
from models import * | |
class IssueForm(ModelForm): | |
class Meta: | |
model = Issue | |
exclude = ('closed','votes') | |
~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>{% block title %}{% endblock %}</title> | |
</head> | |
<body> | |
{% block content %}{% endblock %} | |
</body> | |
</html> | |
~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'base.html' %} | |
{% block title %}Add Issue{% endblock %} | |
{% block content %} | |
<form method="POST" action="/issue/add/"> | |
{{form.as_p}} | |
<input type="submit" value="report"/> | |
</form> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'base.html' %} | |
{% block title %}View Issue{% endblock %} | |
{% block content %} | |
<h3>{{issue.title}}</h3> | |
<p>{{issue.description}}</p> | |
<p>{{issue.location}}</p> | |
<br/>votes: {{issue.votes}} | |
<br/>type: {{issue.issuetype}} | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'base.html' %} | |
{% block title %}list issue{% endblock %} | |
{% block content%} | |
{% for i in issue %} | |
<p> | |
<a href="/issue/view/?id={{i.id}}">{{i.title}}</a> vote:{{i.votes}} | |
</p> | |
{% endfor %} | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.shortcuts import render_to_response | |
from forms import IssueForm | |
from django.http import HttpResponseRedirect | |
from models import * | |
# Create your views here. | |
def add_issue(request): | |
if request.method == 'GET': | |
form = IssueForm() | |
return render_to_response('issue/add.html',{'form':form}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf.urls.defaults import * | |
# Uncomment the next two lines to enable the admin: | |
from django.contrib import admin | |
admin.autodiscover() | |
urlpatterns = patterns('', | |
# Example: | |
# (r'^project/', include('project.foo.urls')), | |
(r'^issue/',include('issue.urls')), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf.urls.defaults import * | |
from views import * | |
urlpatterns = patterns('', | |
(r'add/',add_issue), | |
(r'view/',view_issue), | |
(r'list/',list_issue)) |