From b841a1e5e198fa2f737fd97a4e574142b1734040 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 25 Nov 2015 12:13:35 +0200 Subject: Add checkin flag to Locations --- servo/models/account.py | 7 ------- servo/models/common.py | 13 +++++++++++++ 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'servo/models') diff --git a/servo/models/account.py b/servo/models/account.py index 13718c2..d4549c6 100644 --- a/servo/models/account.py +++ b/servo/models/account.py @@ -150,13 +150,6 @@ class User(AbstractUser): techies = TechieManager() active = ActiveManager() - def get_location_list(self): - results = [] - for l in self.locations.all(): - results.append({'pk': l.pk, 'name': l.title}) - - return results - @classmethod def serialize(cls, queryset): results = [] diff --git a/servo/models/common.py b/servo/models/common.py index 2ab81f0..eedba96 100644 --- a/servo/models/common.py +++ b/servo/models/common.py @@ -462,6 +462,19 @@ class Location(models.Model): verbose_name=_('Enabled') ) + checkin = models.BooleanField( + default=True, + verbose_name=_('Use for check-in') + ) + + @classmethod + def get_checkin_list(cls): + results = [] + for l in cls.objects.filter(checkin=True): + results.append({'pk': l.pk, 'name': l.title}) + + return results + def get_shipto_choices(self): return self.gsx_accounts.values_list('ship_to', 'ship_to') -- cgit v1.2.3