-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmodels.py
More file actions
33 lines (25 loc) · 1.55 KB
/
models.py
File metadata and controls
33 lines (25 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from django.db import models
# models.py
class User:
def __init__(self, user_id, username):
self.user_id = user_id
self.username = username # Added username field
def get_info(self):
return f"User ID: {self.user_id}, Username: {self.username}"
class RockaePackageCatalogue(models.Model):
name = models.CharField(max_length=255, help_text="Name of the AI package or tool")
description = models.TextField(blank=True, null=True, help_text="Detailed description of the AI package's functionality")
repository_url = models.URLField(max_length=500, unique=True, help_text="URL to the package's repository")
ai_category = models.CharField(max_length=100, help_text="Category of AI functionality (e.g., NLP, Computer Vision, Generation)")
integration_type = models.CharField(max_length=100, help_text="Type of integration with Rockae (API, Library, Plugin)")
supported_models = models.TextField(blank=True, null=True, help_text="List of supported AI models and versions")
popularity_score = models.IntegerField(default=0, help_text="A score representing the package's popularity in AI applications")
performance_metrics = models.JSONField(null=True, blank=True, help_text="Performance benchmarks and metrics")
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
def __str__(self):
return self.name
class Meta:
ordering = ['-popularity_score']
verbose_name = 'Open Source Package'
verbose_name_plural = 'Open Source Packages'