-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7ddd0c
commit 6a0700f
Showing
12 changed files
with
82 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
from starlette_admin.contrib.sqla import Admin | ||
from app.core.dependencies import engine | ||
from .views import City, CityView, Vacancy, VacancyView | ||
from app.models import models as m | ||
from . import views as v | ||
|
||
admin = Admin( | ||
engine, | ||
"💾 База данных HRSpace", | ||
) | ||
|
||
admin.add_view(CityView(City)) | ||
admin.add_view(VacancyView(Vacancy)) | ||
admin.add_view(v.VacancyView(m.Vacancy)) | ||
admin.add_view(v.CategoryView(m.Category)) | ||
admin.add_view(v.CityView(m.City)) | ||
admin.add_view(v.ConditionView(m.Condition)) | ||
admin.add_view(v.RequirementsView(m.Requirement)) | ||
admin.add_view(v.ResponsibilitiesView(m.Responsibility)) | ||
admin.add_view(v.SpecializationView(m.Specialization)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,38 @@ | ||
from starlette_admin.contrib.sqla import ModelView | ||
|
||
from app.models.models import City, Specialization, Vacancy | ||
from app.models import models as m | ||
|
||
|
||
class GenericView(ModelView): | ||
fields = ("id", "name") | ||
|
||
|
||
class CityView(GenericView): | ||
model = City | ||
class CityView(ModelView): | ||
model = m.City | ||
name = "Города" | ||
|
||
|
||
class SpecializationView(GenericView): | ||
model = Specialization | ||
class SpecializationView(ModelView): | ||
model = m.Specialization | ||
name = "Специальность" | ||
|
||
|
||
class VacancyView(ModelView): | ||
# fields = "__all__" | ||
model = Vacancy | ||
model = m.Vacancy | ||
name = "Заявка" | ||
|
||
|
||
class CategoryView(ModelView): | ||
model = m.Category | ||
name = "Сфера деятельности" | ||
|
||
|
||
class ConditionView(ModelView): | ||
model = m.Condition | ||
name = "Условия труда" | ||
|
||
|
||
class RequirementsView(ModelView): | ||
model = m.Requirement | ||
name = "Требования" | ||
|
||
|
||
class ResponsibilitiesView(ModelView): | ||
model = m.Responsibility | ||
name = "Обязанности" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
name | ||
Москва | ||
Санкт_Петербург | ||
Санкт-Петербург | ||
Вологда | ||
Казань | ||
Владивосток | ||
Красноярск | ||
Воронеж | ||
Белгород | ||
Белгород |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ POSTGRES_PASSWORD=postgrespw | |
DB_HOST=db | ||
DB_PORT=5432 | ||
POSTGRES_DB=postgres | ||
|
||
SERVER_HOST=localhost |