From fc1f3fcb4b8aeda261b8fde551384bfa9b106b8a Mon Sep 17 00:00:00 2001 From: CodeWizardette Date: Sat, 26 Aug 2023 16:58:27 +0300 Subject: [PATCH] main --- envanter/admins.py | 14 --------- envanter/{ => envanter}/00admins.py | 0 envanter/{ => envanter}/00models.py | 0 envanter/{ => envanter}/__init__.py | 0 .../__pycache__/__init__.cpython-311.pyc | Bin .../__pycache__/models.cpython-311.pyc | Bin .../__pycache__/settings.cpython-311.pyc | Bin .../__pycache__/urls.cpython-311.pyc | Bin .../__pycache__/views.cpython-311.pyc | Bin envanter/envanter/admins.py | 27 ++++++++++++++++ envanter/{ => envanter}/apps.py | 0 envanter/{ => envanter}/asgi.py | 2 +- envanter/{ => envanter}/authentication.py | 0 envanter/envanter/forms.py | 29 ++++++++++++++++++ envanter/{ => envanter}/models.py | 12 ++++---- envanter/{ => envanter}/settings.py | 0 .../teplates/component_detail.html | 0 .../{ => envanter}/teplates/eskiindex.html | 0 envanter/{ => envanter}/teplates/index.html | 0 envanter/{ => envanter}/teplates/profile.html | 0 .../teplates/registration/login.html | 0 .../teplates/registration/register.html | 0 envanter/{ => envanter}/urls.py | 4 --- envanter/{ => envanter}/views.py | 0 envanter/{ => envanter}/wsgi.py | 0 envanter/forms.py | 17 ---------- 26 files changed, 63 insertions(+), 42 deletions(-) delete mode 100644 envanter/admins.py rename envanter/{ => envanter}/00admins.py (100%) rename envanter/{ => envanter}/00models.py (100%) rename envanter/{ => envanter}/__init__.py (100%) rename envanter/{ => envanter}/__pycache__/__init__.cpython-311.pyc (100%) rename envanter/{ => envanter}/__pycache__/models.cpython-311.pyc (100%) rename envanter/{ => envanter}/__pycache__/settings.cpython-311.pyc (100%) rename envanter/{ => envanter}/__pycache__/urls.cpython-311.pyc (100%) rename envanter/{ => envanter}/__pycache__/views.cpython-311.pyc (100%) create mode 100644 envanter/envanter/admins.py rename envanter/{ => envanter}/apps.py (100%) rename envanter/{ => envanter}/asgi.py (82%) rename envanter/{ => envanter}/authentication.py (100%) create mode 100644 envanter/envanter/forms.py rename envanter/{ => envanter}/models.py (78%) rename envanter/{ => envanter}/settings.py (100%) rename envanter/{ => envanter}/teplates/component_detail.html (100%) rename envanter/{ => envanter}/teplates/eskiindex.html (100%) rename envanter/{ => envanter}/teplates/index.html (100%) rename envanter/{ => envanter}/teplates/profile.html (100%) rename envanter/{ => envanter}/teplates/registration/login.html (100%) rename envanter/{ => envanter}/teplates/registration/register.html (100%) rename envanter/{ => envanter}/urls.py (77%) rename envanter/{ => envanter}/views.py (100%) rename envanter/{ => envanter}/wsgi.py (100%) delete mode 100644 envanter/forms.py diff --git a/envanter/admins.py b/envanter/admins.py deleted file mode 100644 index 2cde529..0000000 --- a/envanter/admins.py +++ /dev/null @@ -1,14 +0,0 @@ -from django.contrib import admin -from .models import Category, Component, Subcategory, - -@admin.register(Category) -class CategoryAdmin(admin.ModelAdmin): - list_display = ('name', 'description') - -@admin.register(Component) -class ComponentAdmin(admin.ModelAdmin): - list_display = ('model', 'uretici', 'category', 'birim_fiyat', 'stok_miktar') - -@admin.register(Subcategory) -class SubcategoryAdmin(admin.ModelAdmin): - list_display = ('subcategory') diff --git a/envanter/00admins.py b/envanter/envanter/00admins.py similarity index 100% rename from envanter/00admins.py rename to envanter/envanter/00admins.py diff --git a/envanter/00models.py b/envanter/envanter/00models.py similarity index 100% rename from envanter/00models.py rename to envanter/envanter/00models.py diff --git a/envanter/__init__.py b/envanter/envanter/__init__.py similarity index 100% rename from envanter/__init__.py rename to envanter/envanter/__init__.py diff --git a/envanter/__pycache__/__init__.cpython-311.pyc b/envanter/envanter/__pycache__/__init__.cpython-311.pyc similarity index 100% rename from envanter/__pycache__/__init__.cpython-311.pyc rename to envanter/envanter/__pycache__/__init__.cpython-311.pyc diff --git a/envanter/__pycache__/models.cpython-311.pyc b/envanter/envanter/__pycache__/models.cpython-311.pyc similarity index 100% rename from envanter/__pycache__/models.cpython-311.pyc rename to envanter/envanter/__pycache__/models.cpython-311.pyc diff --git a/envanter/__pycache__/settings.cpython-311.pyc b/envanter/envanter/__pycache__/settings.cpython-311.pyc similarity index 100% rename from envanter/__pycache__/settings.cpython-311.pyc rename to envanter/envanter/__pycache__/settings.cpython-311.pyc diff --git a/envanter/__pycache__/urls.cpython-311.pyc b/envanter/envanter/__pycache__/urls.cpython-311.pyc similarity index 100% rename from envanter/__pycache__/urls.cpython-311.pyc rename to envanter/envanter/__pycache__/urls.cpython-311.pyc diff --git a/envanter/__pycache__/views.cpython-311.pyc b/envanter/envanter/__pycache__/views.cpython-311.pyc similarity index 100% rename from envanter/__pycache__/views.cpython-311.pyc rename to envanter/envanter/__pycache__/views.cpython-311.pyc diff --git a/envanter/envanter/admins.py b/envanter/envanter/admins.py new file mode 100644 index 0000000..03c36ea --- /dev/null +++ b/envanter/envanter/admins.py @@ -0,0 +1,27 @@ +from django.contrib import admin +from .models import Category, Component, Subcategory + +@admin.register(Category) +class CategoryAdmin(admin.ModelAdmin): + list_display = ('name', 'description') + +@admin.register(Component) +class ComponentAdmin(admin.ModelAdmin): + list_display = ('category', + 'model', + 'parca_no', + 'manufacturer', + 'birim_fiyat', + 'stock', + 'location_type', + 'ohm', + 'w', + 'technical_specifications', + 'picture_url', + 'document_url', + + ) + +@admin.register(Subcategory) +class SubcategoryAdmin(admin.ModelAdmin): + list_display = ('subcategory') diff --git a/envanter/apps.py b/envanter/envanter/apps.py similarity index 100% rename from envanter/apps.py rename to envanter/envanter/apps.py diff --git a/envanter/asgi.py b/envanter/envanter/asgi.py similarity index 82% rename from envanter/asgi.py rename to envanter/envanter/asgi.py index d18afbe..0b0a582 100644 --- a/envanter/asgi.py +++ b/envanter/envanter/asgi.py @@ -11,6 +11,6 @@ from django.core.asgi import get_asgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'envanter.settings') +os.environ.setdefault( 'envanter.settings') application = get_asgi_application() diff --git a/envanter/authentication.py b/envanter/envanter/authentication.py similarity index 100% rename from envanter/authentication.py rename to envanter/envanter/authentication.py diff --git a/envanter/envanter/forms.py b/envanter/envanter/forms.py new file mode 100644 index 0000000..54615fb --- /dev/null +++ b/envanter/envanter/forms.py @@ -0,0 +1,29 @@ +from django import forms +from .models import Component, Subcategory, Category + +class SubcategoryForm(forms.ModelForm): + class Meta: + model = Subcategory + fields = ['subcategory'] + +class ComponentForm(forms.ModelForm): + class Meta: + model = Component + fields = [ + 'category', + 'model', + 'parca_no', + 'manufacturer', + 'birim_fiyat', + 'stock', + 'ohm', + 'w', + 'technical_specifications', + 'picture_url', + 'document_url', + ] + +class CategoryForm(forms.ModelForm): + class Meta: + model = Category + fields = ['name', 'description'] diff --git a/envanter/models.py b/envanter/envanter/models.py similarity index 78% rename from envanter/models.py rename to envanter/envanter/models.py index 137dc86..e1168fe 100644 --- a/envanter/models.py +++ b/envanter/envanter/models.py @@ -19,15 +19,15 @@ class Component(models.Model): category = models.ForeignKey(Category, on_delete=models.CASCADE) model = models.CharField(max_length=100) parca_no = models.CharField(max_length=100) - uretici = models.CharField(max_length=100) + manufacturer = models.CharField(max_length=100) birim_fiyat = models.DecimalField(max_digits=10, decimal_places=2) - stok_miktar = models.IntegerField() + stock = models.IntegerField() location_type = models.CharField(max_length=100) Ohm = models.DecimalField(max_digits=10, decimal_places=2) W = models.DecimalField(max_digits=10, decimal_places=2) - teknik_ozellikler = models.TextField() - foto = models.URLField(max_length=500, blank=True) - dokuman = models.URLField(max_length=500, blank=True) - + technical_specifications = models.TextField() + picture_url = models.URLField(max_length=500, blank=True) + document_url = models.URLField(max_length=500, blank=True) + def __str__(self): return self.model diff --git a/envanter/settings.py b/envanter/envanter/settings.py similarity index 100% rename from envanter/settings.py rename to envanter/envanter/settings.py diff --git a/envanter/teplates/component_detail.html b/envanter/envanter/teplates/component_detail.html similarity index 100% rename from envanter/teplates/component_detail.html rename to envanter/envanter/teplates/component_detail.html diff --git a/envanter/teplates/eskiindex.html b/envanter/envanter/teplates/eskiindex.html similarity index 100% rename from envanter/teplates/eskiindex.html rename to envanter/envanter/teplates/eskiindex.html diff --git a/envanter/teplates/index.html b/envanter/envanter/teplates/index.html similarity index 100% rename from envanter/teplates/index.html rename to envanter/envanter/teplates/index.html diff --git a/envanter/teplates/profile.html b/envanter/envanter/teplates/profile.html similarity index 100% rename from envanter/teplates/profile.html rename to envanter/envanter/teplates/profile.html diff --git a/envanter/teplates/registration/login.html b/envanter/envanter/teplates/registration/login.html similarity index 100% rename from envanter/teplates/registration/login.html rename to envanter/envanter/teplates/registration/login.html diff --git a/envanter/teplates/registration/register.html b/envanter/envanter/teplates/registration/register.html similarity index 100% rename from envanter/teplates/registration/register.html rename to envanter/envanter/teplates/registration/register.html diff --git a/envanter/urls.py b/envanter/envanter/urls.py similarity index 77% rename from envanter/urls.py rename to envanter/envanter/urls.py index 9e739de..4bfe41e 100644 --- a/envanter/urls.py +++ b/envanter/envanter/urls.py @@ -16,13 +16,9 @@ from django.urls import path from . import views -from django.contrib.auth import views as auth_views urlpatterns = [ path('', views.index, name='index'), path('parca_ekle', views.parca_ekle, name='parca_ekle'), # URL'yi doğru şekilde belirtin - path('logout/', auth_views.LogoutView.as_view(), name='logout'), - path('register/', views.register, name='register'), - path('login/', auth_views.LoginView.as_view(), name='login'), ] diff --git a/envanter/views.py b/envanter/envanter/views.py similarity index 100% rename from envanter/views.py rename to envanter/envanter/views.py diff --git a/envanter/wsgi.py b/envanter/envanter/wsgi.py similarity index 100% rename from envanter/wsgi.py rename to envanter/envanter/wsgi.py diff --git a/envanter/forms.py b/envanter/forms.py deleted file mode 100644 index bb61c1d..0000000 --- a/envanter/forms.py +++ /dev/null @@ -1,17 +0,0 @@ -from django import forms -from .models import Component, Subcategory, Category, - -class SubcategoryForm(forms.ModelForm): - class Meta: - model = Subcategory - fields = ['subcategory'] - -class ComponentForm(forms.ModelForm): - class Meta: - model = Component - fields = ['category', 'model', 'manufacturer', 'stock', 'ohm', 'w', 'technical_specifications', 'picture_url', 'document_url'] - -class CategoryForm(forms.ModelForm): - class Meta: - model = Category - fields = ['name', 'description']