diff --git a/README.md b/README.md index c42ac4d6371761e63c713444f4109789a2de8a79..31b817a57cf48552b52277eab8896a94f9319b91 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Metagenedb -[](https://gitlab.pasteur.fr/metagenomics/metagenedb/commits/dev) -[](https://gitlab.pasteur.fr/metagenomics/metagenedb/commits/dev) +[](https://gitlab.pasteur.fr/%{project_path}/commits/%{default_branch}) +[](https://gitlab.pasteur.fr/%{project_path}/commits/%{default_branch}) Django based project to build genes catalog and tools to play with it and contact external services. diff --git a/backend/metagenedb/apps/catalog/models/gene.py b/backend/metagenedb/apps/catalog/models/gene.py index 453910d17bc8f6f294027ba448f4c61d63e6191e..d9a5cf3f9a7449cf94d1781f8e65ea1dffdb2c24 100644 --- a/backend/metagenedb/apps/catalog/models/gene.py +++ b/backend/metagenedb/apps/catalog/models/gene.py @@ -20,6 +20,7 @@ class Gene(models.Model): class Meta: ordering = ['-gene_id'] + class GeneFunction(models.Model): gene = models.ForeignKey(Gene, on_delete=models.CASCADE) function = models.ForeignKey(Function, on_delete=models.CASCADE) diff --git a/backend/metagenedb/apps/catalog/serializers/gene.py b/backend/metagenedb/apps/catalog/serializers/gene.py index ec09b388aabaf1dfa6f3799e9d8a0cafb9d9c640..22e6094c8cfad37ce59b0f23a596a4cbfb8214bf 100644 --- a/backend/metagenedb/apps/catalog/serializers/gene.py +++ b/backend/metagenedb/apps/catalog/serializers/gene.py @@ -16,6 +16,10 @@ class GeneListSerializer(BulkListSerializer): class Meta: model = Gene + def create(self, validated_data): + instances = super().create(validated_data) + return instances + class GeneSerializer(serializers.ModelSerializer): functions = FunctionSerializer(