Skip to content
Snippets Groups Projects
Commit 5f01a5ce authored by Carlos Vega's avatar Carlos Vega
Browse files

Issue #246 added methods to check the study voucher and voucher_type property

parent 1828caf1
No related branches found
No related tags found
1 merge request!174Bug/hide vouchers if not set in study
......@@ -29,3 +29,19 @@ class Study(models.Model):
def __unicode__(self):
return "%s" % self.name
@property
def has_voucher_types(self):
return self.columns.voucher_types
@property
def has_vouchers(self):
return self.columns.vouchers
@staticmethod
def get_by_id(study_id):
study = Study.objects.filter(id=study_id)
if len(study) > 0:
return study[0]
else:
return None
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment