Sapan Bhatia | ce657e6 | 2017-04-21 14:20:41 +0200 | [diff] [blame] | 1 | def __init__(self, *args, **kwargs): |
Scott Baker | 589e6c4 | 2017-05-25 16:55:18 -0700 | [diff] [blame] | 2 | exampleservice = ExampleService.objects.all() |
Sapan Bhatia | ce657e6 | 2017-04-21 14:20:41 +0200 | [diff] [blame] | 3 | if exampleservice: |
| 4 | self._meta.get_field('provider_service').default = exampleservice[0].id |
| 5 | super(ExampleTenant, self).__init__(*args, **kwargs) |
| 6 | |
| 7 | def save(self, *args, **kwargs): |
| 8 | super(ExampleTenant, self).save(*args, **kwargs) |
| 9 | model_policy_exampletenant(self.pk) |
| 10 | |
| 11 | def delete(self, *args, **kwargs): |
| 12 | self.cleanup_container() |
| 13 | super(ExampleTenant, self).delete(*args, **kwargs) |
| 14 | |