質問編集履歴
2
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -78,9 +78,9 @@
|
|
78
78
|
{% for customer in customerlist %}
|
79
79
|
<tr>
|
80
80
|
<td>{{customer}}</td>
|
81
|
-
|
81
|
+
{% for sales in sales_for_each_site %}
|
82
82
|
<td style = "text-align:right">{{sales | intcomma}}</td>
|
83
|
-
{% endfor %}
|
83
|
+
{% endfor %}
|
84
84
|
</tr>
|
85
85
|
{% endfor %}
|
86
86
|
</table>
|
1
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
customer_id = models.ForeignKey(Customer) #顧客ID
|
18
18
|
ammount = models.IntegerField(u'金額')
|
19
19
|
def __unicode__(self):
|
20
|
-
return u"%s" % self.
|
20
|
+
return u"%s" % self.customer_id
|
21
21
|
```
|
22
22
|
views.pyをどうしたらよいか分からないのですが、現状、下記のようにしています。
|
23
23
|
```python
|
@@ -39,7 +39,7 @@
|
|
39
39
|
first_date_of_each_month = date.fromtimestamp(time.mktime((first_date_of_each_month.year,first_date_of_each_month.month + 1,1,0,0,0,0,0,0)))
|
40
40
|
months.append(first_date_of_each_month) #ここまでで、 [datetime.date(2012, 10, 1), datetime.date(2012, 11, 1), ・・・,, datetime.date(2015, 10, 1)]というリストができます(これ自体はうまくいっています)。
|
41
41
|
|
42
|
-
|
42
|
+
sales_for_each_customer= [] #顧客毎の売上を入れるための空のリスト
|
43
43
|
|
44
44
|
for customer in customerlist:
|
45
45
|
sales = Sales.objects.filter(customer_id = customer) #各顧客への売上をピックアップ
|