Commit e84e50db authored by Alice's avatar Alice

Add brokenlink model.

parent fa7c65dd
......@@ -64,6 +64,8 @@ class Type (Model):
def __str__(self):
class Entrepreneur(Model):
user = models.OneToOneField(settings.AUTH_USER_MODEL, related_name="entrepreneur_profile")
organisation = models.ForeignKey(Organisation, null=True, on_delete=models.CASCADE, related_name="entrepreneurs")
......@@ -207,7 +209,11 @@ class Request (Model):
authenticated_perms = ['inherit', 'add']
owner_field = 'submitter'
serializer_fields=["@id", "name", "description", "skills", "fields", "language",\
<<<<<<< Updated upstream
"organisation", "submitter", "created_on", "target", "country"]
"organisation", "submitter", "reviewer", "created_on", "target", "country", "status"]
>>>>>>> Stashed changes
owner_perms = ['inherit', 'change', 'control', 'delete']
nested_fields=["language", "fields", "organisation", "submitter", "country"]
container_path = 'requests/'
......@@ -216,6 +222,24 @@ class Request (Model):
def __str__(self):
class BrokenLink(Model):
submitter = models.OneToOneField(settings.AUTH_USER_MODEL, related_name="brokenlink_submitter")
resource_id = models.ForeignKey(Resource, null=True, on_delete=models.CASCADE, related_name="resource_id")
class Meta:
auto_author = 'submitter'
owner_field = 'submitter'
owner_perms = ['inherit', 'change', 'control', 'delete']
anonymous_perms = ['view']
authenticated_perms = ['inherit', 'add']
serializer_fields=["@id", "submitter", "resource_id"]
nested_fields=["submitter", "resource_id"]
container_path = 'brokenlink/'
rdf_type = 'coopstarter:brokenlink'
def __str__(self):
return self.user.get_full_name()
@receiver(post_save, sender=Resource)
def create_review(sender, instance, created, **kwargs):
if created:
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