File tree Expand file tree Collapse file tree 6 files changed +20
-3
lines changed Expand file tree Collapse file tree 6 files changed +20
-3
lines changed Original file line number Diff line number Diff line change
1
+ from django import forms
2
+ from .models import Tip
3
+
4
+ class Tip (forms .Form ):
5
+ name = forms .CharField (max_length = 100 )
6
+ authors = forms .ModelMultipleChoiceField (queryset = Tip .objects .all ())
Original file line number Diff line number Diff line change 2
2
3
3
from django .db import models
4
4
5
+ from django .forms import ModelForm
6
+
5
7
# Create your models here.
6
8
7
9
class Question (models .Model ):
@@ -21,6 +23,12 @@ def __str__(self):
21
23
class Tip (models .Model ):
22
24
23
25
tip = models .CharField (max_length = 200 )
26
+ location = models .CharField (max_length = 200 )
24
27
25
28
def __str__ (self ):
26
29
return self .tip
30
+
31
+ class TipForm (ModelForm ):
32
+ class Meta :
33
+ model = Tip
34
+ fields = ['tip' , 'location' ]
Original file line number Diff line number Diff line change @@ -430,10 +430,10 @@ <h4> Thank you for caring </h4>
430
430
< script src ="http://code.jquery.com/jquery-1.10.2.js "> </ script >
431
431
<!-- <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> -->
432
432
< script src ="{% static 'plugins.js' %} "> </ script >
433
- < script src ="js/ main.js "> </ script >
433
+ < script src ="{% static ' main.js' %} "> </ script >
434
434
435
435
< script src ="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js "> </ script >
436
- < script type ="text/javascript " src ="js/ jquery.accordion.js "> </ script >
436
+ < script type ="text/javascript " src ="{% static ' jquery.accordion.js' %} "> </ script >
437
437
< script type ="text/javascript ">
438
438
var progress = 0 ;
439
439
Original file line number Diff line number Diff line change 5
5
6
6
{% load staticfiles %}
7
7
8
+ < script src ="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js "> </ script >
8
9
< meta http-equiv ="x-ua-compatible " content ="ie=edge ">
9
10
< title > </ title >
10
11
< meta name ="description " content ="">
Original file line number Diff line number Diff line change 17
17
{% block content %}
18
18
19
19
< table id ="fronttable " class ="table ">
20
- < thead > < tr > < th > Question name</ th > </ tr > </ thead >
20
+ < thead > < tr > < div class ="site-desc-quiz ">
21
+ < p > Question name</ p >
22
+ </ div > </ tr > </ thead >
21
23
< tbody >
22
24
{% for question in latest_question_list %}
23
25
< tr >
You can’t perform that action at this time.
0 commit comments