Skip to content

Commit

Permalink
Admin Panel, Property Category İlişkisi
Browse files Browse the repository at this point in the history
  • Loading branch information
mervegundogmus committed Aug 7, 2020
0 parents commit a587bc7
Show file tree
Hide file tree
Showing 53 changed files with 644 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions .idea/rentHouse.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

188 changes: 188 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"# renthouse"
Binary file added db.sqlite3
Binary file not shown.
Empty file added home/__init__.py
Empty file.
Binary file added home/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added home/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file added home/__pycache__/apps.cpython-38.pyc
Binary file not shown.
Binary file added home/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file added home/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file added home/__pycache__/views.cpython-38.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions home/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
5 changes: 5 additions & 0 deletions home/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class HomeConfig(AppConfig):
name = 'home'
Empty file added home/migrations/__init__.py
Empty file.
Binary file added home/migrations/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions home/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
15 changes: 15 additions & 0 deletions home/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>İlk Django Sayfası</title>
</head>
<body>
<h1>Selam Canım, Ben Senin Amcanım</h1>
<h3>Merve Gündoğmuş</h3>
<p>
{{ text | safe }}
</p>

</body>
</html>
3 changes: 3 additions & 0 deletions home/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
11 changes: 11 additions & 0 deletions home/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from django.urls import path

from . import views

urlpatterns = [
# ex: /home/
path('', views.index, name='index'),

# ex: /polls/5/
# path('<int:question_id>/', views.detail, name='detail'),
]
9 changes: 9 additions & 0 deletions home/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.http import HttpResponse
from django.shortcuts import render

#Create your views here.

def index(request):
text="Merhaba Django <br> PyCharm Editör"
context = {'text': text}
return render(request, 'index.html', context)
22 changes: 22 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys


def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'renthouse.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)


if __name__ == '__main__':
main()
Empty file added property/__init__.py
Empty file.
Binary file added property/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added property/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file added property/__pycache__/apps.cpython-38.pyc
Binary file not shown.
Binary file added property/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file added property/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file added property/__pycache__/views.cpython-38.pyc
Binary file not shown.
16 changes: 16 additions & 0 deletions property/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from django.contrib import admin

# Register your models here.
from property.models import Category, Property


class CategoryAdmin(admin.ModelAdmin):
list_display = ['title', 'description', 'status']
list_filter = ['status']

class PropertyAdmin(admin.ModelAdmin):
list_display = ['title', 'category', 'price', 'amount', 'status']
list_filter = ['status']

admin.site.register(Category,CategoryAdmin)
admin.site.register(Property, PropertyAdmin)
5 changes: 5 additions & 0 deletions property/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class PropertyConfig(AppConfig):
name = 'property'
30 changes: 30 additions & 0 deletions property/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Generated by Django 3.1 on 2020-08-07 00:13

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=150)),
('keywords', models.CharField(max_length=255)),
('description', models.CharField(max_length=30)),
('image', models.ImageField(blank=True, upload_to='images/')),
('status', models.CharField(choices=[('True', 'Evet'), ('False', 'Hayir')], max_length=10)),
('slug', models.SlugField(unique=True)),
('create_at', models.DateTimeField(auto_now_add=True)),
('update_at', models.DateTimeField(auto_now=True)),
('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='property.category')),
],
),
]
Loading

0 comments on commit a587bc7

Please sign in to comment.