Commit 9536ead8 authored by Benoit Alessandroni's avatar Benoit Alessandroni

First push to the CI

parent 56da96f7
Pipeline #4873 passed with stage
in 30 seconds
......@@ -25,6 +25,6 @@ publish:
- semantic-release publish
- do_not_publish
- master
- sib
from django.contrib import admin
from .models import Like
import factory
import hashlib
from .models import ExampleModel
from .models import Like
from django.db.models.signals import post_save
class ExampleFactory(factory.django.DjangoModelFactory):
class LikeFactory(factory.django.DjangoModelFactory):
class Meta:
model = ExampleModel
model = Like
# Please refer to Factory boy documentation
from django.db import models
from djangoldp.fields import IdURLField
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.conf import settings
from django.utils import timezone
class Like(models.Model):
sender = IdURLField(max_length=300)
receiver_content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
receiver_object_id = models.PositiveIntegerField()
receiver = GenericForeignKey(
timestamp = models.DateTimeField(
# Please refer to Django documentation
class Meta:
serializer_fields = ['sender']
container_path = 'likes/'
rdf_type = 'coopstarter:like'
anonymous_perms = ['view']
authenticated_perms = ['inherit', 'add']
owner_perms = ['inherit', 'change', 'control', 'delete']
# unique_together = ['sender', 'receiver_content_type', 'receiver_object_id']
def __str__(self):
return self.sender
\ No newline at end of file
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