Menu

[r193]: / trunk / docs / htdocs / examples / 2008-03-11-basic-scatterplot / models.py  Maximize  Restore  History

Download this file

27 lines (22 with data), 773 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from dataplot import plotmodels as models
from dataplot import R
class PlayerManager(models.Manager):
def SquareScatter_args(self):
qs=self.filter(games__gte=5)
return {
'y':[x.team_goals_per_game for x in qs],
'ylab':"Team goals per game",
'x':[x.goals_per_game for x in qs],
'xlab':"Goals per game",
'main':"Your contribution to your team's goals",
'ann':[x.name for x in qs],
}
class Player(models.Model):
name=models.CharField(max_length=100,unique=True)
goals_per_game=models.FloatField()
team_goals_per_game=models.FloatField()
games=models.IntegerField()
objects=PlayerManager()
MANAGER_DATAPLOTS=[
R.SquareScatter,
]
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.