feat(games): support non-steam games
This commit is contained in:
@@ -2,9 +2,10 @@ from django.db import models
|
||||
|
||||
|
||||
class Game(models.Model):
|
||||
steam_app_id = models.PositiveIntegerField(unique=True)
|
||||
steam_app_id = models.PositiveIntegerField(null=True, blank=True)
|
||||
name = models.CharField(max_length=255)
|
||||
path = models.CharField(max_length=100)
|
||||
image = models.URLField(null=True, blank=True)
|
||||
enabled = models.BooleanField(default=True)
|
||||
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
@@ -14,4 +15,6 @@ class Game(models.Model):
|
||||
ordering = ["name"]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"{self.name} ({self.steam_app_id})"
|
||||
if self.steam_app_id:
|
||||
return f"{self.name} ({self.steam_app_id})"
|
||||
return self.name
|
||||
|
||||
Reference in New Issue
Block a user