Permalink
Browse files

template de chart e unicode nos models

  • Loading branch information...
1 parent 9742cf5 commit 43ba71859d95038e7f8fb363e6081436e5a1900e @setuid setuid committed Oct 27, 2012
Showing with 20 additions and 2 deletions.
  1. BIN previsao/previsao.db
  2. +16 −0 previsao/report/models.py
  3. +4 −2 previsao/report/templates/report/chart.html
View
Binary file not shown.
View
@@ -1,3 +1,4 @@
+# coding: utf-8
from django.db import models
DIRECTIONS = (
@@ -20,20 +21,35 @@ class ReportDay( models.Model ):
fivePM = models.ForeignKey('Report', related_name='fivePM_report')
eightPM = models.ForeignKey('Report', related_name='eightPM_report')
+ def __unicode__(self):
+ return unicode(self.date)
+
class Report( models.Model ):
waveReport = models.ForeignKey('WaveReport')
windReport = models.ForeignKey('WindReport')
tideReport = models.ForeignKey('TideReport')
+ def __unicode__(self):
+ return "Wave: %s(m), %s" % (self.waveReport.height, self.waveReport.direction )
+
class WaveReport( models.Model ):
direction = models.CharField(max_length = 3, choices = DIRECTIONS )
height = models.CharField( max_length = 3 )
period = models.CharField( max_length = 3 )
+ def __unicode__(self):
+ return "Wave: %s(m), %s, %s" % (self.height, self.direction, self.period )
+
+
class WindReport( models.Model ):
direction = models.CharField(max_length = 3, choices = DIRECTIONS )
intensity = models.CharField( max_length = 3 )
+ def __unicode__(self):
+ return "Wind: %s (nos), %s" % ( self.intensity, self.direction )
+
class TideReport( models.Model ):
height = models.CharField( max_length = 3 )
+ def __unicode__(self):
+ return "Tide: %s (m)" % ( self.height )
@@ -22,7 +22,8 @@
{
type: 'linear',
location: 'left',
- title: 'altura (m)'
+ title: 'altura (m)',
+ interval: 0.1
},
{
type: 'dateTime',
@@ -48,7 +49,8 @@
{
type: 'linear',
location: 'left',
- title: 'velocidade (nós)'
+ title: 'velocidade (nós)',
+ interval: 0.5
},
{
type: 'dateTime',

0 comments on commit 43ba718

Please sign in to comment.