Libraries

This commit is contained in:
Frank Wiles
2022-06-09 16:12:25 -05:00
parent ee8de62643
commit 1added29ba
8 changed files with 60 additions and 0 deletions

0
libraries/__init__.py Normal file
View File

3
libraries/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
libraries/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class LibrariesConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'libraries'

View File

48
libraries/models.py Normal file
View File

@@ -0,0 +1,48 @@
from django.db import models
class Category(models.Model):
"""
Library categories such as:
- Math and Numerics
- Algorithms
- etc
"""
name = models.CharField(max_length=100)
def __str__(self):
return self.name
class Library(models.Model):
"""
Model to represent component Libraries of Boost
"""
name = models.CharField(max_length=100, db_index=True)
description = models.TextField(blank=True, null=True)
github_url = models.URLField(max_length=500, blank=True, null=True)
first_release = models.ForeignKey(
"versions.Version",
related_name="first_releases",
on_delete=models.CASCADE,
blank=True,
null=True,
)
cpp_standard_minimum = models.CharField(max_length=50, blank=True, null=True)
active_development = models.BooleanField(default=True, db_index=True)
last_github_update = models.DateTimeField(blank=True, null=True, db_index=True)
categories = models.ManyToManyField(Category, related_name="libraries")
authors = models.ManyToManyField("users.User", related_name="authors")
maintainers = models.ManyToManyField("users.User", related_name="maintainers")
closed_prs_per_month = models.IntegerField(blank=True, null=True)
open_issues = models.IntegerField(blank=True, null=True)
commits_per_release = models.IntegerField(blank=True, null=True)
def __str__(self):
return self.name

View File

View File

3
libraries/views.py Normal file
View File

@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.