Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎨 Clean up #3

Merged
merged 4 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# Generated by Django 5.2 on 2024-11-15 08:55
# Generated by Django 5.2 on 2024-11-21 10:48

import django.db.models.deletion
import lnschema_core.fields
import lnschema_core.ids
import lnschema_core.models
import lnschema_core.users
from django.db import migrations, models
from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
(
"lnschema_core",
"0069_alter_artifact__accessor_alter_artifact__hash_type_and_more",
),
("lnschema_core", "0069_squashed"),
("ourprojects", "0001_initial"),
]

Expand All @@ -23,6 +20,7 @@ class Migration(migrations.Migration):
name="artifact",
field=lnschema_core.fields.ForeignKey(
blank=True,
default=None,
on_delete=django.db.models.deletion.CASCADE,
related_name="links_project",
to="lnschema_core.artifact",
Expand Down Expand Up @@ -75,6 +73,7 @@ class Migration(migrations.Migration):
name="project",
field=lnschema_core.fields.ForeignKey(
blank=True,
default=None,
on_delete=django.db.models.deletion.PROTECT,
related_name="links_artifact",
to="ourprojects.project",
Expand Down Expand Up @@ -157,6 +156,8 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="project",
name="url",
field=models.URLField(blank=True, default=None, max_length=255, null=True),
field=lnschema_core.fields.URLField(
blank=True, default=None, max_length=255, null=True
),
),
]
14 changes: 5 additions & 9 deletions ourprojects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.db import models
from django.db.models import CASCADE, PROTECT
from lnschema_core import ids
from lnschema_core.fields import BooleanField, CharField, ForeignKey
from lnschema_core.fields import BooleanField, CharField, ForeignKey, URLField
from lnschema_core.models import (
Artifact,
CanCurate,
Expand Down Expand Up @@ -32,15 +32,11 @@ class Meta(Record.Meta, TracksRun.Meta, TracksUpdates.Meta):
"""Internal id, valid only in one DB instance."""
uid: str = CharField(unique=True, max_length=12, default=ids.base62_12)
"""Universal id, valid across DB instances."""
name: str = CharField(max_length=255, default=None, db_index=True)
name: str = CharField(db_index=True)
"""Title or name of the Project."""
abbr: str | None = CharField(
max_length=32, db_index=True, unique=True, null=True, default=None
)
abbr: str | None = CharField(max_length=32, db_index=True, unique=True, null=True)
"""A unique abbreviation."""
url: str | None = models.URLField(
max_length=255, null=True, default=None, blank=True
)
url: str | None = URLField(max_length=255, null=True, default=None)
"""A URL to view."""
artifacts: Artifact = models.ManyToManyField(
Artifact, through="ArtifactProject", related_name="Projects"
Expand All @@ -52,7 +48,7 @@ class ArtifactProject(Record, LinkORM, TracksRun):
id: int = models.BigAutoField(primary_key=True)
artifact: Artifact = ForeignKey(Artifact, CASCADE, related_name="links_project")
project: Project = ForeignKey(Project, PROTECT, related_name="links_artifact")
feature: Feature = ForeignKey(
feature: Feature | None = ForeignKey(
Feature,
PROTECT,
null=True,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [{name = "Lamin Labs", email = "open-source@lamin.ai"}]
readme = "README.md"
dynamic = ["version", "description"]
dependencies = [
"lamindb"
"lamindb>=0.77.0"
]

[project.urls]
Expand Down
Loading