from django.db import models import datetime class Accespoint(models.Model): mac = models.CharField(max_length=17) ssid = models.CharField(max_length=64) encryptie = models.BooleanField() def __unicode__(self): return (self.mac, self.ssid) class Meting(models.Model): accespoint = models.ForeignKey(Accespoint) gebruiker = models.ForeignKey(Gebruiker) #eventueel lat = models.DecimalField(max_digits=9, decimal_places=7) lng = models.DecimalField(max_digits=9, decimal_places=7) signaal = models.IntegerField(max_length=3) datum = models.DateTimeField() #eventueel class Gebruiker(models.Model): gebruiker = models.CharField(max_length=64) apparatuur = models.Charfield(max_length=64) def __unicode__(self): return (self.gebruiker, self.apparatuur)