Commit 6db4e292 authored by Rafal's avatar Rafal

beacon manager

parent ab00259d
......@@ -27,7 +27,7 @@ class Beacon(models.Model):
description = models.CharField(max_length=300, null=True)
longitude = models.DecimalField(max_digits=9, decimal_places=6)
latitude = models.DecimalField(max_digits=9, decimal_places=6)
beacon_manager = models.OneToOneField('BeaconManager', blank=True)
beacon_manager = models.OneToOneField('BeaconManager', blank=True, related_name='beacon_manager')
def __str__(self):
return "name: {name}, uuid:{uuid}".format(name=self.name, uuid=self.uuid)
......
......@@ -27,7 +27,7 @@ class BeaconSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Beacon
fields = ('id', 'url', 'uuid', 'name', 'description', 'longitude', 'latitude')
fields = ('id', 'url', 'uuid', 'name', 'description', 'longitude', 'latitude', 'beacon_manager')
class BeaconManagerSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment