Added the free limit to the detailed service representation.

This commit is contained in:
Martyn Inglis
2017-06-07 14:19:25 +01:00
parent d97c7c8e56
commit fa0d51b66c
2 changed files with 18 additions and 0 deletions

View File

@@ -260,6 +260,11 @@ class ServiceSchema(BaseSchema):
class DetailedServiceSchema(BaseSchema):
statistics = fields.Dict()
free_sms_fragment_limit = fields.Method(method_name='get_free_sms_fragment_limit')
def get_free_sms_fragment_limit(selfs, service):
return service.free_sms_fragment_limit()
class Meta:
model = models.Service
exclude = (