diff options
Diffstat (limited to 'python/packages')
-rw-r--r-- | python/packages/__init__.py | 0 | ||||
-rw-r--r-- | python/packages/admin.py | 3 | ||||
-rw-r--r-- | python/packages/apps.py | 5 | ||||
-rw-r--r-- | python/packages/migrations/__init__.py | 0 | ||||
-rw-r--r-- | python/packages/models.py | 188 | ||||
-rw-r--r-- | python/packages/tests.py | 3 | ||||
-rw-r--r-- | python/packages/urls.py | 7 | ||||
-rw-r--r-- | python/packages/views.py | 3 |
8 files changed, 0 insertions, 209 deletions
diff --git a/python/packages/__init__.py b/python/packages/__init__.py deleted file mode 100644 index e69de29..0000000 --- a/python/packages/__init__.py +++ /dev/null diff --git a/python/packages/admin.py b/python/packages/admin.py deleted file mode 100644 index 8c38f3f..0000000 --- a/python/packages/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.contrib import admin - -# Register your models here. diff --git a/python/packages/apps.py b/python/packages/apps.py deleted file mode 100644 index 8bc7b4d..0000000 --- a/python/packages/apps.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.apps import AppConfig - - -class PackagesConfig(AppConfig): - name = 'packages' diff --git a/python/packages/migrations/__init__.py b/python/packages/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 --- a/python/packages/migrations/__init__.py +++ /dev/null diff --git a/python/packages/models.py b/python/packages/models.py deleted file mode 100644 index 943ffe5..0000000 --- a/python/packages/models.py +++ /dev/null @@ -1,188 +0,0 @@ -import uuid -from django.db import models - -StatusEnum = models.TextChoices('StatusEnum', 'failed completed in-progress waiting') - -class Repos(models.Model): - RepoType = models.TextChoices('RepoType', 'project ebuild') - uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False, db_column='uuid') - name = models.CharField(max_length=255) - status = models.CharField(max_length=255, choices=StatusEnum.choices, default='waiting', blank=True) - description = models.TextField() - src_url = models.URLField() - auto = models.BooleanField(default=False) - repo_type = models.CharField(max_length=255, choices=RepoType.choices, default='ebuild', blank=True) - created_at = models.DateTimeField(auto_now_add=True) - updated_at = models.DateTimeField(auto_now=True) - deleted_at = models.DateTimeField(auto_now=True) - deleted = models.BooleanField(default=False) - - class Meta: - db_table = 'repos' - def __str__(self): - return '%s %s %s %s %s %s %s %s %s %s %s %s %s' % (self.uuid, self.name, self.status, self.mirror_status, self.local_status, self.description, self.src_url, self.auto, self.repo_type, self.created_at, self.updated_at, self.deleted_at, self.deleted) - - def soft_delete(self): - self.deleted = True - self.save() - -class Categories(models.Model): - uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) - name = models.CharField(max_length=255) - status = models.CharField(max_length=255, choices=StatusEnum.choices, default='waiting', blank=True) - created_at = models.DateTimeField(auto_now_add=True) - updated_at = models.DateTimeField(auto_now=True) - deleted_at = models.DateTimeField(auto_now=True) - deleted = models.BooleanField(default=False) - class Meta: - db_table = 'categories' - def __str__(self): - return '%s %s %s %s' % (self.uuid, self.name, self.status, self.deleted) - - def soft_delete(self): - self.deleted = True - self.save() -class CategoriesMetadata(models.Model): - id = models.IntegerField(primary_key=True) - category_uuid = models.ForeignKey(Categories, on_delete=models.CASCADE) - description = models.CharField(max_length=200) - checksum = models.CharField(max_length=255) - class Meta: - db_table = 'categories_metadata' - def __str__(self): - return '%s %s %s %s %s %s %s %s %s %s' % (self.id, self.uuid, self.description, self.checksum) - -class Packages(models.Model): - uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) - name = models.CharField(max_length=255) - status = models.CharField(max_length=255, choices=StatusEnum.choices, default='waiting', blank=True) - category_uuid = models.ForeignKey(Categories, on_delete=models.CASCADE) - repo_uuid = models.ForeignKey(Repos, on_delete=models.CASCADE) - created_at = models.DateTimeField(auto_now_add=True) - updated_at = models.DateTimeField(auto_now=True) - deleted_at = models.DateTimeField(auto_now=True) - deleted = models.BooleanField(default=False) - class Meta: - db_table = 'packages' - def __str__(self): - return '%s %s %s %s %s %s' % (self.uuid, self.name, self.status, self.category_uuid, self.repo_uuid, self.deleted) - - def soft_delete(self): - self.deleted = True - self.save() - -class PackagesMetadata(models.Model): - id = models.IntegerField(primary_key=True) - package_uuid = models.ForeignKey(Packages, on_delete=models.CASCADE) - gitlog = models.TextField() - descriptions = models.TextField() - checksum = models.CharField(max_length=255) - class Meta: - db_table = 'packages_metadata' - def __str__(self): - return '%s %s %s %s' % (self.id, self.package_uuid, self.gitlog, self.descriptions, self.checksum) - -class Emails(models.Model): - id = models.IntegerField(primary_key=True) - email = models.CharField(max_length=150) - class Meta: - db_table = 'emails' - def __str__(self): - return '%s %s' % (self.id, self.email) - -class PackagesEmails(models.Model): - id = models.IntegerField(primary_key=True) - package_uuid = models.ForeignKey(Packages, on_delete=models.CASCADE) - email_id = models.ForeignKey(Emails, on_delete=models.CASCADE) - class Meta: - db_table = 'packages_emails' - def __str__(self): - return '%s %s %s %s' % (self.id, self.package_uuid, self.email_id) - -class Ebuilds(models.Model): - uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) - version = models.CharField(max_length=20) - package_uuid = models.ForeignKey(Packages, on_delete=models.CASCADE) - checksum = models.CharField(max_length=100) - status = models.CharField(max_length=255, choices=StatusEnum.choices, default='waiting', blank=True) - created_at = models.DateTimeField(auto_now_add=True) - updated_at = models.DateTimeField(auto_now=True) - deleted_at = models.DateTimeField(auto_now=True) - deleted = models.BooleanField(default=False) - class Meta: - db_table = 'ebuilds' - def __str__(self): - return '%s %s %s %s %s %s %s' % (self.uuid, self.version, self.package_uuid, self.checksum, self.status self.deleted) - - def soft_delete(self): - self.deleted = True - self.save() - -class EbuildsMetadata(models.Model): - id = models.IntegerField(primary_key=True) - ebuild_uuid = models.ForeignKey(Ebuilds, on_delete=models.CASCADE) - commit = models.CharField(max_length=30) - commit_msg = models.CharField(max_length=200) - description = models.CharField(max_length=200) - slot = models.CharField(max_length=10) - homepage = models.CharField(max_length=200) - license = models.CharField(max_length=200) - class Meta: - db_table = 'ebuilds_metadata' - def __str__(self): - return '%s %s %s %s %s %s %s %s' % (self.id, self.uuid, self.commit, self.commit_msg, self.description, self.slot, self.homepage, self.license) - -class Uses(models.Model): - id = models.IntegerField(primary_key=True) - flag = models.CharField(max_length=150) - description = models.CharField(max_length=200) - class Meta: - db_table = 'uses' - def __str__(self): - return '%s %s %s' % (self.id, self.flag, self.description) - -class Keywords(models.Model): - id = models.IntegerField(primary_key=True) - keyword = models.CharField(max_length=45) - class Meta: - db_table = 'keywords' - def __str__(self): - return '%s %s %s' % (self.id, self.keyword) - -class Restrictions(models.Model): - id = models.IntegerField(primary_key=True) - restriction = models.CharField(max_length=150) - class Meta: - db_table = 'restrictions' - def __str__(self): - return '%s %s %s' % (self.id, self.restriction) - -class EbuildsKeywords(models.Model): - KeywordEnum = models.TextChoices('KeywordEnum', 'stable unstable negative') - id = models.IntegerField(primary_key=True) - ebuild_uuid = models.ForeignKey(Ebuilds) - keyword_id = models.ForeignKey(Keywords) - status = models.CharField(max_length=24 blank=True, choices=KeywordEnum.choices) - class Meta: - db_table = 'ebuilds_keywords' - def __str__(self): - return '%s %s %s' % (self.ebuild_uuid, self.keyword_id, self.status) - -class EbuildsIuse(models.Model): - id = models.IntegerField(primary_key=True) - ebuild_uuid = models.ForeignKey(Ebuilds) - use_id = models.ForeignKey(Uses) - status =models.BooleanField(default=False) - class Meta: - db_table = 'ebuilds_iuse' - def __str__(self): - return '%s %s %s %s' % (self.id, self.ebuild_uuid, self.use_id, self.status) - -class EbuildsRestrictions(models.Model): - id = models.IntegerField(primary_key=True) - ebuild_uuid = models.ForeignKey(Ebuilds) - restriction_id = models.ForeignKey(Restrictions) - class Meta: - db_table = 'ebuilds_restrictions' - def __str__(self): - return '%s %s' % (self.ebuild_uuid, self.restriction_id) diff --git a/python/packages/tests.py b/python/packages/tests.py deleted file mode 100644 index 7ce503c..0000000 --- a/python/packages/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/python/packages/urls.py b/python/packages/urls.py deleted file mode 100644 index 88a9cac..0000000 --- a/python/packages/urls.py +++ /dev/null @@ -1,7 +0,0 @@ -from django.urls import path - -from . import views - -urlpatterns = [ - path('', views.index, name='index'), -] diff --git a/python/packages/views.py b/python/packages/views.py deleted file mode 100644 index 91ea44a..0000000 --- a/python/packages/views.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.shortcuts import render - -# Create your views here. |