Skip to content

Commit

Permalink
main
Browse files Browse the repository at this point in the history
  • Loading branch information
ixnur committed Aug 26, 2023
1 parent 1cb29a6 commit fc1f3fc
Show file tree
Hide file tree
Showing 26 changed files with 63 additions and 42 deletions.
14 changes: 0 additions & 14 deletions envanter/admins.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions envanter/envanter/admins.py
Original file line number Diff line number Diff line change
@@ -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')
File renamed without changes.
2 changes: 1 addition & 1 deletion envanter/asgi.py → envanter/envanter/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
File renamed without changes.
29 changes: 29 additions & 0 deletions envanter/envanter/forms.py
Original file line number Diff line number Diff line change
@@ -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']
12 changes: 6 additions & 6 deletions envanter/models.py → envanter/envanter/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions envanter/urls.py → envanter/envanter/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),

]
File renamed without changes.
File renamed without changes.
17 changes: 0 additions & 17 deletions envanter/forms.py

This file was deleted.

0 comments on commit fc1f3fc

Please sign in to comment.