Commit 0f9cf017 authored by Robert's avatar Robert

Added data collection method

parent 906577fd
Pipeline #1241 failed with stage
in 1 minute and 38 seconds
......@@ -73,6 +73,28 @@ class Gestalt(core.models.Model):
def get_contact_url(self):
return urls.reverse('create-gestalt-conversation', args=(self.pk,))
def get_data(self):
'''
Return all data directly related to this gestalt. May be used e.g. in conjunction with
deleting users.
'''
data = {}
data['gestalt'] = self
data['user'] = self.user
#data['groups_created'] = ?
data['memberships'] = self.memberships
data['subscriptions'] = self.subscriptions
data['tokens'] = self.permissiontoken_set
data['settings'] = self.gestaltsetting_set
data['associations'] = self.associations
data['contributions'] = self.contributions
data['images'] = self.images
data['versions'] = self.versions
data['votes'] = self.votes
return data
def get_profile_url(self):
return urls.reverse(
'entity', args=[type(self).objects.get(pk=self.pk).user.username])
......
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