From 72e783545f1a65070335cdb148d0b14f842cf1fa Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Mon, 17 Sep 2018 18:43:54 -0600 Subject: [PATCH] Add MAC address field to tools --- authserver/README.md | 31 ++++++++++++++++------------- authserver/authserver/api/models.py | 1 + 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/authserver/README.md b/authserver/README.md index 490b924..d29054b 100644 --- a/authserver/README.md +++ b/authserver/README.md @@ -66,49 +66,52 @@ Example response: { "categories": [ { - "url": "http://127.0.0.1:8000/category/wood-shop/", + "url": "http://tools-auth.protospace.ca/category/wood-shop/", "tools": [ { - "url": "http://127.0.0.1:8000/tool/table-saw/", - "category": "http://127.0.0.1:8000/category/wood-shop/", + "url": "http://tools-auth.protospace.ca/tool/table-saw/", + "category": "http://tools-auth.protospace.ca/category/wood-shop/", "name": "Table Saw", "slug": "table-saw", "info": "scary tool", "wiki_id": 123, - "photo": "http://127.0.0.1:8000/media/floodgf.jpg" + "photo": "http://tools-auth.protospace.ca/media/DSC00125.jpg", + "mac": "2C3AE843A15F" }, { - "url": "http://127.0.0.1:8000/tool/jointer/", - "category": "http://127.0.0.1:8000/category/wood-shop/", + "url": "http://tools-auth.protospace.ca/tool/jointer/", + "category": "http://tools-auth.protospace.ca/category/wood-shop/", "name": "Jointer", "slug": "jointer", "info": "goes buzz buzz", "wiki_id": 1, - "photo": "http://127.0.0.1:8000/media/uq4ldzsp4bu01.jpg" + "photo": "http://tools-auth.protospace.ca/media/uq4ldzsp4bu01.jpg", + "mac": "2C3AE8439EAD" } ], "name": "Wood Shop", "slug": "wood-shop", "info": "protospace wood shop", - "photo": "http://127.0.0.1:8000/media/photo_2018-05-06_13-26-59.jpg" + "photo": "http://tools-auth.protospace.ca/media/ps-wood-shop.jpg" }, { - "url": "http://127.0.0.1:8000/category/metal-shop/", + "url": "http://tools-auth.protospace.ca/category/metal-shop/", "tools": [ { - "url": "http://127.0.0.1:8000/tool/metal-lathe/", - "category": "http://127.0.0.1:8000/category/metal-shop/", + "url": "http://tools-auth.protospace.ca/tool/metal-lathe/", + "category": "http://tools-auth.protospace.ca/category/metal-shop/", "name": "Metal Lathe", "slug": "metal-lathe", "info": "spins fast", "wiki_id": 42, - "photo": "http://127.0.0.1:8000/media/intro-metal-shop-vali-steele-97.jpeg" + "photo": "http://tools-auth.protospace.ca/media/lathe.jpeg", + "mac": "ABCDEF000003" } ], "name": "Metal Shop", "slug": "metal-shop", "info": "protospace metal shop", - "photo": "http://127.0.0.1:8000/media/photo_2018-05-08_17-57-02.jpg" + "photo": "http://tools-auth.protospace.ca/media/metal-shop02.jpg" } ] } @@ -127,7 +130,7 @@ Example response: { "username": "admin", "profile": { - "url": "http://127.0.0.1:8000/profile/1/", + "url": "http://tools-auth.protospace.ca/profile/1/", "user": "admin", "authorized_tools": [ "table-saw", diff --git a/authserver/authserver/api/models.py b/authserver/authserver/api/models.py index e24c27b..2f077a0 100644 --- a/authserver/authserver/api/models.py +++ b/authserver/authserver/api/models.py @@ -17,6 +17,7 @@ class Tool(models.Model): info = models.TextField(max_length=1024, blank=True) wiki_id = models.IntegerField() photo = models.ImageField(blank=True) + mac = models.CharField(max_length=12) def __str__(self): return self.name