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:
script:
- semantic-release publish
only:
- do_not_publish
- master
tags:
- sib
from django.contrib import admin
from .models import Like
admin.site.register(Like)
import factory
import hashlib
from .models import ExampleModel
from .models import Like
from django.db.models.signals import post_save
@factory.django.mute_signals(post_save)
class ExampleFactory(factory.django.DjangoModelFactory):
class LikeFactory(factory.django.DjangoModelFactory):
class Meta:
model = ExampleModel
model = Like
# Please refer to Factory boy documentation
# https://factoryboy.readthedocs.io
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(
ct_field="receiver_content_type",
fk_field="receiver_object_id"
)
timestamp = models.DateTimeField(default=timezone.now)
# 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