From b712e98815e9354b36dd1e27fb411594df020693 Mon Sep 17 00:00:00 2001 From: Conrad Date: Fri, 10 Jan 2020 21:50:57 +0100 Subject: [PATCH] Added test admin interface --- src/asiimov/settings.py | 1 + src/core/admin.py | 6 ++++++ src/core/models.py | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/asiimov/settings.py b/src/asiimov/settings.py index b2359fe..1afbb69 100644 --- a/src/asiimov/settings.py +++ b/src/asiimov/settings.py @@ -31,6 +31,7 @@ ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ + 'core', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', diff --git a/src/core/admin.py b/src/core/admin.py index 8c38f3f..9c242e0 100644 --- a/src/core/admin.py +++ b/src/core/admin.py @@ -1,3 +1,9 @@ from django.contrib import admin +from .models import ItemType, Stickers, ItemInstance, Badge, Gamer + # Register your models here. +@admin.register(ItemType) +class ItemTypeAdmin(admin.ModelAdmin): + list_display = ('paint_index', 'name', 'type', 'rarity', 'min_float', 'max_float', 'tradable') + list_editable = () diff --git a/src/core/models.py b/src/core/models.py index bff8c47..7849913 100644 --- a/src/core/models.py +++ b/src/core/models.py @@ -21,7 +21,7 @@ class ItemType(models.model): classid = models.IntegerField() # Weapon Class appid = models.IntegerField() # The appid which items of this type belong to - market_tradable_restriction = models.IntegerField() # How long the item will be trade locked + tradable = models.BooleanField(default=False) # Wether the item is tradable or not icon_url = models.URLField(max_length=512, null=True) name = models.CharField(max_length=1000) # i.e. ★ Butterfly Knife name_color = models.CharField(max_length=7) # Hexadecimal color of the name @@ -41,7 +41,7 @@ class Stickers(models.model): class ItemInstance(models.model): item_class = models.ForeignKey(ItemType, on_delete=models.PROTECT) instanceid = models.IntegerField(primary_key=True, unique=True) # 0 for something like cases, which will be excluded here - tradable = models.BooleanField(default=False) + market_tradable_restriction = models.IntegerField() # How long the item will be trade locked inspect_link = models.URLField(max_length=512, null=True) wear = models.CharField(max_length=100) # tags > category = exterior > localized_tag_name float = models.FloatField() # Float of the object