def tags(self, create, extracted, **kwargs): tags = [] if extracted: tags = extracted else: if MembershipApplicationTag.objects.all().count(): tags = get_random_objects(MembershipApplicationTag, random.randint(1, MembershipApplicationTag.objects.all().count())) for tag in tags: self.tags.add(tag)
def grants(self, create, extracted, **kwargs): grants = [] if extracted: grants = extracted else: if AccessType.objects.all().count(): grants = get_random_objects(AccessType, random.randint(1, AccessType.objects.all().count())) for grant in grants: self.grants.add(grant)
def mtypes(self, create, extracted, **kwargs): mtypes = [] if extracted: mtypes = extracted else: if not MemberType.objects.all().count(): types.generate_standard_set() mtypes = get_random_objects(MemberType, random.randint(1, MemberType.objects.all().count())) for mtype in mtypes: self.mtypes.add(mtype)
def grants(self, create, extracted, **kwargs): grants = [] if extracted: grants = extracted else: if AccessType.objects.all().count(): grants = get_random_objects( AccessType, random.randint(1, AccessType.objects.all().count())) for grant in grants: self.grants.add(grant)