diff options
author | Andrew Godwin | 2022-11-11 22:02:43 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-11-11 22:02:43 -0700 |
commit | feb5d9b74fa1e8454eaaf29afae3643c6d7c81f1 (patch) | |
tree | 3889a826dfc2c852aa4873daff2a27cb7c1a2b01 /statuses/models | |
parent | fbfad9fbf5e061cb7c658dada3c4014c9796021c (diff) | |
download | takahe-feb5d9b74fa1e8454eaaf29afae3643c6d7c81f1.tar.gz takahe-feb5d9b74fa1e8454eaaf29afae3643c6d7c81f1.tar.bz2 takahe-feb5d9b74fa1e8454eaaf29afae3643c6d7c81f1.zip |
Got up to incoming posts working
Diffstat (limited to 'statuses/models')
-rw-r--r-- | statuses/models/__init__.py | 1 | ||||
-rw-r--r-- | statuses/models/status.py | 42 |
2 files changed, 0 insertions, 43 deletions
diff --git a/statuses/models/__init__.py b/statuses/models/__init__.py deleted file mode 100644 index 84098eb..0000000 --- a/statuses/models/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .status import Status # noqa diff --git a/statuses/models/status.py b/statuses/models/status.py deleted file mode 100644 index b12a595..0000000 --- a/statuses/models/status.py +++ /dev/null @@ -1,42 +0,0 @@ -import urlman -from django.db import models - - -class Status(models.Model): - class StatusVisibility(models.IntegerChoices): - public = 0 - unlisted = 1 - followers = 2 - mentioned = 3 - - identity = models.ForeignKey( - "users.Identity", - on_delete=models.PROTECT, - related_name="statuses", - ) - - local = models.BooleanField() - uri = models.CharField(max_length=500, blank=True, null=True) - visibility = models.IntegerField( - choices=StatusVisibility.choices, - default=StatusVisibility.public, - ) - text = models.TextField() - - created = models.DateTimeField(auto_now_add=True) - updated = models.DateTimeField(auto_now=True) - deleted = models.DateTimeField(null=True, blank=True) - - class Meta: - verbose_name_plural = "statuses" - - @classmethod - def create_local(cls, identity, text: str): - return cls.objects.create( - identity=identity, - text=text, - local=True, - ) - - class urls(urlman.Urls): - view = "{self.identity.urls.view}statuses/{self.id}/" |