Skip to content

Commit

Permalink
main
Browse files Browse the repository at this point in the history
  • Loading branch information
ixnur committed Aug 18, 2023
1 parent 8009906 commit a462770
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
57 changes: 56 additions & 1 deletion envanter/envanter/admins.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.contrib import admin
from .models import Category, Component, Manufacturer
from .models import Category, Component, Manufacturer, W, Ohm, DocumentType, Document, Datasheet, Package, LocationType, Location, Supplier, Purchase, ComponentDocumentLink, PurchaseDetail, PictureURL


@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
Expand All @@ -12,3 +13,57 @@ class ComponentAdmin(admin.ModelAdmin):
@admin.register(Manufacturer)
class ManufacturerAdmin(admin.ModelAdmin):
list_display = ('name',)


@admin.register(W)
class WAdmin(admin.ModelAdmin):
list_display = ('value',)

@admin.register(Ohm)
class OhmAdmin(admin.ModelAdmin):
list_display = ('value',)

@admin.register(DocumentType)
class DocumentTypeAdmin(admin.ModelAdmin):
list_display = ('name',)

@admin.register(Document)
class DocumentAdmin(admin.ModelAdmin):
list_display = ('title', 'document_type')

@admin.register(Datasheet)
class DatasheetAdmin(admin.ModelAdmin):
list_display = ('title', 'document')

@admin.register(Package)
class PackageAdmin(admin.ModelAdmin):
list_display = ('name',)

@admin.register(LocationType)
class LocationTypeAdmin(admin.ModelAdmin):
list_display = ('name',)

@admin.register(Location)
class LocationAdmin(admin.ModelAdmin):
list_display = ('name', 'location_type')

@admin.register(Supplier)
class SupplierAdmin(admin.ModelAdmin):
list_display = ('name',)

@admin.register(Purchase)
class PurchaseAdmin(admin.ModelAdmin):
list_display = ('supplier', 'date')

@admin.register(ComponentDocumentLink)
class ComponentDocumentLinkAdmin(admin.ModelAdmin):
list_display = ('component', 'document')

@admin.register(PurchaseDetail)
class PurchaseDetailAdmin(admin.ModelAdmin):
list_display = ('purchase', 'component', 'quantity')

@admin.register(PictureURL)
class PictureURLAdmin(admin.ModelAdmin):
list_display = ('component', 'url')

1 change: 1 addition & 0 deletions envanter/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import sys



def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'envanter.settings')
Expand Down

0 comments on commit a462770

Please sign in to comment.