This commit is contained in:
Marwan Alwali 2024-12-26 12:47:44 +03:00
commit 2456a806bc
3 changed files with 26 additions and 15 deletions

3
.gitignore vendored
View File

@ -6,10 +6,11 @@ __pycache__
**/*__pycache__ **/*__pycache__
db.sqlite3 db.sqlite3
media media
./car_inventory/settings.py ./car_inventory/settings*
# Backup files # # Backup files #
*.bak *.bak
# If you are using PyCharm # # If you are using PyCharm #
# User-specific stuff # User-specific stuff
.idea/**/workspace.xml .idea/**/workspace.xml

View File

@ -104,24 +104,24 @@ WSGI_APPLICATION = 'car_inventory.wsgi.application'
# Database # Database
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases # https://docs.djangoproject.com/en/5.0/ref/settings/#databases
DATABASES = {
"default": {
"ENGINE": "django_prometheus.db.backends.postgresql",
"NAME": "murad_haikal",
"USER": "f95166",
"PASSWORD": "Kfsh&rc9788",
"HOST": "localhost",
"PORT": 5432,
}
}
# DATABASES = { # DATABASES = {
# 'default': { # "default": {
# 'ENGINE': 'django.db.backends.sqlite3', # "ENGINE": "django_prometheus.db.backends.postgresql",
# 'NAME': 'db.sqlite3', # "NAME": "murad_haikal",
# "USER": "f95166",
# "PASSWORD": "Kfsh&rc9788",
# "HOST": "localhost",
# "PORT": 5432,
# } # }
# } # }
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite3',
}
}
# Password validation # Password validation
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators # https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators

View File

@ -29,6 +29,16 @@ from django.db.models import FloatField
from .mixins import LocalizedNameMixin from .mixins import LocalizedNameMixin
from django_ledger.models import EntityModel from django_ledger.models import EntityModel
UNIT_CHOICES = (
("Kg", _("Kg")),
("L", _("L")),
("m", _("m")),
("cm", _("cm")),
("m2", _("m2")),
("m3", _("m3")),
("m3", _("m3")),
)
class CarMake(models.Model, LocalizedNameMixin): class CarMake(models.Model, LocalizedNameMixin):
id_car_make = models.AutoField(primary_key=True) id_car_make = models.AutoField(primary_key=True)
name = models.CharField(max_length=255) name = models.CharField(max_length=255)