source: src/django_gheat/gheat/models.py@ 9170

Last change on this file since 9170 was 9164, checked in by rick, 14 years ago

A Floatfield is not type float but type str. Guess that seems to make no sence...

File size: 1.7 KB
Line 
1from django.db import models
2from gheat import managers
3import datetime
4
5class Accespoint(models.Model):
6 mac = models.CharField(max_length=17)
7 ssid = models.CharField(max_length=64)
8 encryptie = models.BooleanField()
9 def __unicode__(self):
10 return "%s - %s" % (self.mac, self.ssid)
11
12class Gebruiker(models.Model):
13 naam = models.CharField(max_length=64)
14 email = models.CharField(max_length=64)
15 def __unicode__(self):
16 return "%s - %s" % (self.naam, self.email)
17
18class Apparatuur(models.Model):
19 antenne = models.CharField(max_length=64)
20 kaart = models.CharField(max_length=64)
21 def __unicode__(self):
22 return "%s - %s" % (self.antenne, self.kaart)
23
24class MeetRondje(models.Model):
25 datum = models.DateTimeField()
26 naam = models.CharField(max_length=64)
27 gebruiker = models.ForeignKey(Gebruiker)
28 apparatuur = models.ForeignKey(Apparatuur)
29 def __unicode__(self):
30 return "%s - %s" % (self.gebruiker.naam, self.naam)
31
32class Meting(models.Model):
33 meetrondje = models.ForeignKey(MeetRondje)
34 accespoint = models.ForeignKey(Accespoint)
35 latitude = models.FloatField(name='Latitude', db_column='lat')
36 longitude = models.FloatField(name='Longitude', db_column='lng')
37 signaal = models.IntegerField(max_length=3)
38 objects = managers.MetingManager()
39 def __unicode__(self):
40 return "%s @ %.5f,%.5f : %s" % (self.accespoint.ssid, float(self.latitude), float(self.longitude), self.signaal)
41
42class Node(models.Model):
43 naam = models.CharField(max_length=64)
44 ssid = models.CharField(max_length=64)
45 latitude = models.FloatField(name='Latitude', db_column='lat')
46 longitude = models.FloatField(name='Longitude', db_column='lon')
47 def __unicode__(self):
48 return "%s - %s - %s - %s" % (self.naam, self.ssid, self.latitude, self.longitude)
Note: See TracBrowser for help on using the repository browser.