diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..b490608 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/../../../../../../:\Users\IRAN\PycharmProjects\backend02\.idea/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/backend02.iml b/.idea/backend02.iml new file mode 100644 index 0000000..e982916 --- /dev/null +++ b/.idea/backend02.iml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml new file mode 100644 index 0000000..11495ba --- /dev/null +++ b/.idea/dataSources.xml @@ -0,0 +1,11 @@ + + + + + mysql.8 + true + com.mysql.cj.jdbc.Driver + jdbc:mysql://localhost:3306/coditors02 + + + \ No newline at end of file diff --git a/.idea/dataSources/1d92571e-66c0-4762-9b72-399fb0a9deec.xml b/.idea/dataSources/1d92571e-66c0-4762-9b72-399fb0a9deec.xml new file mode 100644 index 0000000..9d099e5 --- /dev/null +++ b/.idea/dataSources/1d92571e-66c0-4762-9b72-399fb0a9deec.xml @@ -0,0 +1,1396 @@ + + + + + 8.0.19 + InnoDB + InnoDB + lower/lower + + + 1 + utf8mb4_0900_ai_ci + + + utf8_general_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8_general_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_0900_ai_ci + + + armscii8 + + + armscii8 + 1 + + + ascii + + + ascii + 1 + + + big5 + + + big5 + 1 + + + binary + 1 + + + cp1250 + + + cp1250 + + + cp1250 + + + cp1250 + 1 + + + cp1250 + + + cp1251 + + + cp1251 + + + cp1251 + 1 + + + cp1251 + + + cp1251 + + + cp1256 + + + cp1256 + 1 + + + cp1257 + + + cp1257 + 1 + + + cp1257 + + + cp850 + + + cp850 + 1 + + + cp852 + + + cp852 + 1 + + + cp866 + + + cp866 + 1 + + + cp932 + + + cp932 + 1 + + + dec8 + + + dec8 + 1 + + + eucjpms + + + eucjpms + 1 + + + euckr + + + euckr + 1 + + + gb18030 + + + gb18030 + 1 + + + gb18030 + + + gb2312 + + + gb2312 + 1 + + + gbk + + + gbk + 1 + + + geostd8 + + + geostd8 + 1 + + + greek + + + greek + 1 + + + hebrew + + + hebrew + 1 + + + hp8 + + + hp8 + 1 + + + keybcs2 + + + keybcs2 + 1 + + + koi8r + + + koi8r + 1 + + + koi8u + + + koi8u + 1 + + + latin1 + + + latin1 + + + latin1 + + + latin1 + + + latin1 + + + latin1 + + + latin1 + + + latin1 + 1 + + + latin2 + + + latin2 + + + latin2 + + + latin2 + 1 + + + latin2 + + + latin5 + + + latin5 + 1 + + + latin7 + + + latin7 + + + latin7 + 1 + + + latin7 + + + macce + + + macce + 1 + + + macroman + + + macroman + 1 + + + sjis + + + sjis + 1 + + + swe7 + + + swe7 + 1 + + + tis620 + + + tis620 + 1 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + 1 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ujis + + + ujis + 1 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + 1 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16le + + + utf16le + 1 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + 1 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + 1 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8mb4 + 1 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + localhost + SELECT + + + + localhost + SHUTDOWN,SUPER +BACKUP_ADMIN,CLONE_ADMIN,CONNECTION_ADMIN,PERSIST_RO_VARIABLES_ADMIN,SESSION_VARIABLES_ADMIN,SYSTEM_USER,SYSTEM_VARIABLES_ADMIN +SELECT|performance_schema:null +SELECT|mysql.user:null + + + + localhost + TRIGGER|sys:null +SELECT|sys.sys_config:null + + + + localhost + SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,RELOAD,SHUTDOWN,PROCESS,FILE,REFERENCES,INDEX,ALTER,SHOW DATABASES,SUPER,CREATE TEMPORARY TABLES,LOCK TABLES,EXECUTE,REPLICATION SLAVE,REPLICATION CLIENT,CREATE VIEW,SHOW VIEW,CREATE ROUTINE,ALTER ROUTINE,CREATE USER,EVENT,TRIGGER,CREATE TABLESPACE,CREATE ROLE,DROP ROLE! +APPLICATION_PASSWORD_ADMIN,AUDIT_ADMIN,BACKUP_ADMIN,BINLOG_ADMIN,BINLOG_ENCRYPTION_ADMIN,CLONE_ADMIN,CONNECTION_ADMIN,ENCRYPTION_KEY_ADMIN,GROUP_REPLICATION_ADMIN,INNODB_REDO_LOG_ARCHIVE,PERSIST_RO_VARIABLES_ADMIN,REPLICATION_APPLIER,REPLICATION_SLAVE_ADMIN,RESOURCE_GROUP_ADMIN,RESOURCE_GROUP_USER,ROLE_ADMIN,SERVICE_CONNECTION_ADMIN,SESSION_VARIABLES_ADMIN,SET_USER_ID,SYSTEM_USER,SYSTEM_VARIABLES_ADMIN,TABLE_ENCRYPTION_ADMIN,XA_RECOVER_ADMIN! + + + +
+
+
+
+
+
+
+
+
+
+ + 1 + int|0s + 1 + null + + + 2 + varchar(150)|0s + 1 + + + name + 1 + btree + + + 1 + id + 1 + + + name + name + + + 1 + int|0s + 1 + null + + + 2 + int|0s + 1 + + + 3 + int|0s + 1 + + + group_id +permission_id + 1 + btree + + + permission_id + btree + + + 1 + id + 1 + + + group_id +permission_id + auth_group_permissions_group_id_permission_id_0cd325b0_uniq + + + group_id + auth_group + id + + + permission_id + auth_permission + id + + + 1 + int|0s + 1 + null + + + 2 + varchar(255)|0s + 1 + + + 3 + int|0s + 1 + + + 4 + varchar(100)|0s + 1 + + + content_type_id +codename + 1 + btree + + + 1 + id + 1 + + + content_type_id +codename + auth_permission_content_type_id_codename_01ab375a_uniq + + + content_type_id + django_content_type + id + + + 1 + int|0s + 1 + null + + + 2 + varchar(128)|0s + 1 + + + 3 + datetime(6)|0s + + + 4 + tinyint(1)|0s + 1 + + + 5 + varchar(150)|0s + 1 + + + 6 + varchar(150)|0s + 1 + + + 7 + varchar(150)|0s + 1 + + + 8 + varchar(254)|0s + 1 + + + 9 + tinyint(1)|0s + 1 + + + 10 + tinyint(1)|0s + 1 + + + 11 + datetime(6)|0s + 1 + + + username + 1 + btree + + + 1 + id + 1 + + + username + username + + + 1 + int|0s + 1 + null + + + 2 + int|0s + 1 + + + 3 + int|0s + 1 + + + user_id +group_id + 1 + btree + + + group_id + btree + + + 1 + id + 1 + + + user_id +group_id + auth_user_groups_user_id_group_id_94350c0c_uniq + + + user_id + auth_user + id + + + group_id + auth_group + id + + + 1 + int|0s + 1 + null + + + 2 + int|0s + 1 + + + 3 + int|0s + 1 + + + user_id +permission_id + 1 + btree + + + permission_id + btree + + + 1 + id + 1 + + + user_id +permission_id + auth_user_user_permissions_user_id_permission_id_14a6b632_uniq + + + user_id + auth_user + id + + + permission_id + auth_permission + id + + + 1 + int|0s + 1 + null + + + 2 + datetime(6)|0s + 1 + + + 3 + longtext|0s + + + 4 + varchar(200)|0s + 1 + + + 5 + smallint unsigned|0s + 1 + + + 6 + longtext|0s + 1 + + + 7 + int|0s + + + 8 + int|0s + 1 + + + content_type_id + btree + + + user_id + btree + + + 1 + id + 1 + + + content_type_id + django_content_type + id + + + user_id + auth_user + id + + + 1 + int|0s + 1 + null + + + 2 + varchar(100)|0s + 1 + + + 3 + varchar(100)|0s + 1 + + + app_label +model + 1 + btree + + + 1 + id + 1 + + + app_label +model + django_content_type_app_label_model_76bd3d3b_uniq + + + 1 + int|0s + 1 + null + + + 2 + varchar(255)|0s + 1 + + + 3 + varchar(255)|0s + 1 + + + 4 + datetime(6)|0s + 1 + + + 1 + id + 1 + + + 1 + varchar(40)|0s + 1 + + + 2 + longtext|0s + 1 + + + 3 + datetime(6)|0s + 1 + + + expire_date + btree + + + 1 + session_key + 1 + + + 1 + int|0s + 1 + null + + + 2 + varchar(100)|0s + 1 + + + 3 + varchar(100)|0s + 1 + + + 4 + longtext|0s + 1 + + + 5 + decimal(15,3 digit)|0s + 1 + + + 6 + varchar(100)|0s + 1 + + + 7 + datetime(6)|0s + 1 + + + 8 + datetime(6)|0s + 1 + + + 1 + id + 1 + + + \ No newline at end of file diff --git a/.idea/dataSources/1d92571e-66c0-4762-9b72-399fb0a9deec/storage_v2/_src_/schema/information_schema.FNRwLQ.meta b/.idea/dataSources/1d92571e-66c0-4762-9b72-399fb0a9deec/storage_v2/_src_/schema/information_schema.FNRwLQ.meta new file mode 100644 index 0000000..1ff3db2 --- /dev/null +++ b/.idea/dataSources/1d92571e-66c0-4762-9b72-399fb0a9deec/storage_v2/_src_/schema/information_schema.FNRwLQ.meta @@ -0,0 +1,2 @@ +#n:information_schema +! [null, 0, null, null, -2147483648, -2147483648] diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d1e22ec --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..e34ded4 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/__pycache__/manage.cpython-38.pyc b/__pycache__/manage.cpython-38.pyc new file mode 100644 index 0000000..c012b7e Binary files /dev/null and b/__pycache__/manage.cpython-38.pyc differ diff --git a/accounts/__pycache__/__init__.cpython-38.pyc b/accounts/__pycache__/__init__.cpython-38.pyc index a7ddb6c..92caa73 100644 Binary files a/accounts/__pycache__/__init__.cpython-38.pyc and b/accounts/__pycache__/__init__.cpython-38.pyc differ diff --git a/accounts/__pycache__/admin.cpython-38.pyc b/accounts/__pycache__/admin.cpython-38.pyc index ab66bcd..4d75062 100644 Binary files a/accounts/__pycache__/admin.cpython-38.pyc and b/accounts/__pycache__/admin.cpython-38.pyc differ diff --git a/accounts/__pycache__/models.cpython-38.pyc b/accounts/__pycache__/models.cpython-38.pyc index 52a3209..55187cf 100644 Binary files a/accounts/__pycache__/models.cpython-38.pyc and b/accounts/__pycache__/models.cpython-38.pyc differ diff --git a/accounts/__pycache__/urls.cpython-38.pyc b/accounts/__pycache__/urls.cpython-38.pyc index e4f3102..cdf5b94 100644 Binary files a/accounts/__pycache__/urls.cpython-38.pyc and b/accounts/__pycache__/urls.cpython-38.pyc differ diff --git a/accounts/__pycache__/views.cpython-38.pyc b/accounts/__pycache__/views.cpython-38.pyc index d2f46f6..82865dc 100644 Binary files a/accounts/__pycache__/views.cpython-38.pyc and b/accounts/__pycache__/views.cpython-38.pyc differ diff --git a/accounts/migrations/__pycache__/__init__.cpython-38.pyc b/accounts/migrations/__pycache__/__init__.cpython-38.pyc index 3788812..f268e2d 100644 Binary files a/accounts/migrations/__pycache__/__init__.cpython-38.pyc and b/accounts/migrations/__pycache__/__init__.cpython-38.pyc differ diff --git a/backend/__pycache__/__init__.cpython-38.pyc b/backend/__pycache__/__init__.cpython-38.pyc index 799f770..dd93a2f 100644 Binary files a/backend/__pycache__/__init__.cpython-38.pyc and b/backend/__pycache__/__init__.cpython-38.pyc differ diff --git a/backend/__pycache__/settings.cpython-38.pyc b/backend/__pycache__/settings.cpython-38.pyc index 6e36f40..eb7fa71 100644 Binary files a/backend/__pycache__/settings.cpython-38.pyc and b/backend/__pycache__/settings.cpython-38.pyc differ diff --git a/backend/__pycache__/urls.cpython-38.pyc b/backend/__pycache__/urls.cpython-38.pyc index ca37945..f2d98d3 100644 Binary files a/backend/__pycache__/urls.cpython-38.pyc and b/backend/__pycache__/urls.cpython-38.pyc differ diff --git a/backend/__pycache__/wsgi.cpython-38.pyc b/backend/__pycache__/wsgi.cpython-38.pyc index 50b2ac9..4cb5275 100644 Binary files a/backend/__pycache__/wsgi.cpython-38.pyc and b/backend/__pycache__/wsgi.cpython-38.pyc differ diff --git a/backend/settings.py b/backend/settings.py index 52c081f..e893bb8 100644 --- a/backend/settings.py +++ b/backend/settings.py @@ -50,6 +50,7 @@ 'allauth.account', #apps "accounts", + 'newjob', ] SITE_ID = 1 @@ -167,4 +168,8 @@ # https://docs.djangoproject.com/en/3.1/howto/static-files/ STATIC_URL = '/static/' -LOGOUT_REDIRECT_URL = 'login' \ No newline at end of file +STATICFILES_DIRS = [ + BASE_DIR / "static", +] + +LOGOUT_REDIRECT_URL = 'login' diff --git a/backend/urls.py b/backend/urls.py index 501f581..00372d4 100644 --- a/backend/urls.py +++ b/backend/urls.py @@ -5,5 +5,6 @@ urlpatterns = [ path('admin/', admin.site.urls), path('accounts/', include('accounts.urls')), - path("api/", include('accounts.urls')) + path("api/", include('accounts.urls')), + path('newjob/',include('newjob.urls')) ] diff --git a/manage.py b/manage.py index eb6431e..18fd19d 100755 --- a/manage.py +++ b/manage.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python + """Django's command-line utility for administrative tasks.""" import os import sys diff --git a/newjob/__init__.py b/newjob/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/newjob/__pycache__/__init__.cpython-38.pyc b/newjob/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000..1c27418 Binary files /dev/null and b/newjob/__pycache__/__init__.cpython-38.pyc differ diff --git a/newjob/__pycache__/admin.cpython-38.pyc b/newjob/__pycache__/admin.cpython-38.pyc new file mode 100644 index 0000000..003fd44 Binary files /dev/null and b/newjob/__pycache__/admin.cpython-38.pyc differ diff --git a/newjob/__pycache__/forms.cpython-38.pyc b/newjob/__pycache__/forms.cpython-38.pyc new file mode 100644 index 0000000..f4494d0 Binary files /dev/null and b/newjob/__pycache__/forms.cpython-38.pyc differ diff --git a/newjob/__pycache__/models.cpython-38.pyc b/newjob/__pycache__/models.cpython-38.pyc new file mode 100644 index 0000000..e706f29 Binary files /dev/null and b/newjob/__pycache__/models.cpython-38.pyc differ diff --git a/newjob/__pycache__/urls.cpython-38.pyc b/newjob/__pycache__/urls.cpython-38.pyc new file mode 100644 index 0000000..6065f95 Binary files /dev/null and b/newjob/__pycache__/urls.cpython-38.pyc differ diff --git a/newjob/__pycache__/views.cpython-38.pyc b/newjob/__pycache__/views.cpython-38.pyc new file mode 100644 index 0000000..bb2665e Binary files /dev/null and b/newjob/__pycache__/views.cpython-38.pyc differ diff --git a/newjob/admin.py b/newjob/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/newjob/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/newjob/apps.py b/newjob/apps.py new file mode 100644 index 0000000..f0a7252 --- /dev/null +++ b/newjob/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class NewjobConfig(AppConfig): + name = 'newjob' diff --git a/newjob/forms.py b/newjob/forms.py new file mode 100644 index 0000000..a3c0d0f --- /dev/null +++ b/newjob/forms.py @@ -0,0 +1,9 @@ + +from django import forms +from .models import Newjob + +class NewjobForm(forms.ModelForm): + + class Meta: + model = Newjob + fields = ['title', 'type', 'background', 'price', 'image'] \ No newline at end of file diff --git a/newjob/migrations/0001_initial.py b/newjob/migrations/0001_initial.py new file mode 100644 index 0000000..5c5d048 --- /dev/null +++ b/newjob/migrations/0001_initial.py @@ -0,0 +1,27 @@ +# Generated by Django 3.1.6 on 2021-03-04 06:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Newjob', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=100)), + ('type', models.CharField(max_length=100)), + ('background', models.TextField()), + ('price', models.DecimalField(decimal_places=3, max_digits=15)), + ('image', models.ImageField(upload_to='static/newjob/images/')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ], + ), + ] diff --git a/newjob/migrations/__init__.py b/newjob/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/newjob/migrations/__pycache__/0001_initial.cpython-38.pyc b/newjob/migrations/__pycache__/0001_initial.cpython-38.pyc new file mode 100644 index 0000000..767c1ee Binary files /dev/null and b/newjob/migrations/__pycache__/0001_initial.cpython-38.pyc differ diff --git a/newjob/migrations/__pycache__/__init__.cpython-38.pyc b/newjob/migrations/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000..f741983 Binary files /dev/null and b/newjob/migrations/__pycache__/__init__.cpython-38.pyc differ diff --git a/newjob/models.py b/newjob/models.py new file mode 100644 index 0000000..fa9eaa4 --- /dev/null +++ b/newjob/models.py @@ -0,0 +1,12 @@ +from django.db import models + +# Create your models here. + +class Newjob(models.Model): + title = models.CharField(max_length=100, null=False) + type = models.CharField(max_length=100, null=False) + background = models.TextField() + price = models.DecimalField(max_digits= 15, decimal_places=3, null=False) + image = models.ImageField(upload_to='static/newjob/images/') + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) \ No newline at end of file diff --git a/newjob/templates/job/create.html b/newjob/templates/job/create.html new file mode 100644 index 0000000..6e1b56c --- /dev/null +++ b/newjob/templates/job/create.html @@ -0,0 +1,34 @@ +{% extends 'base.html' %} + +{% block content %} + +

ثبت کار

+
+ {% csrf_token %} + +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +{% endblock %} \ No newline at end of file diff --git a/newjob/templates/job/read.html b/newjob/templates/job/read.html new file mode 100644 index 0000000..a803c1e --- /dev/null +++ b/newjob/templates/job/read.html @@ -0,0 +1,45 @@ +{% extends 'base.html' %} + +{% block content %} + +

کار ها

+ کار جدید +
+
+ + + + + + + + + + + + + + {% for job in jobs %} + + + + + + + + + + + + {% endfor %} + + +
عنواننوعقیمتعکستاریخ ساختتاریخ ویرایشعملیات
{{ job.title }}{{ job.type }}{{ job.price }} + T_T + {{ job.created_at }}{{ job.updated_at }} + ویرایش + حذف +
+ + +{% endblock %} \ No newline at end of file diff --git a/newjob/templates/job/update.html b/newjob/templates/job/update.html new file mode 100644 index 0000000..e646039 --- /dev/null +++ b/newjob/templates/job/update.html @@ -0,0 +1,35 @@ +{% extends 'base.html' %} + +{% block content %} + +

ویرایش کار

+
+ {% csrf_token %} + +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ + +{% endblock %} \ No newline at end of file diff --git a/newjob/tests.py b/newjob/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/newjob/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/newjob/urls.py b/newjob/urls.py new file mode 100644 index 0000000..410d2ae --- /dev/null +++ b/newjob/urls.py @@ -0,0 +1,10 @@ + +from django.urls import path +from . import views + +urlpatterns = [ + path('create', views.create, name="create.newjob"), #localhost:8000/newjob/create + path('read', views.read, name="read.newjob"), #localhost:8000/newjob/read + path('update/', views.update, name="update.newjob"), #localhost:8000/newjob/update/id + path('delete/', views.delete, name="delete.newjob"), #localhost:8000/newjob/delete/id +] \ No newline at end of file diff --git a/newjob/views.py b/newjob/views.py new file mode 100644 index 0000000..7fca7be --- /dev/null +++ b/newjob/views.py @@ -0,0 +1,34 @@ +from django.shortcuts import render, redirect +from .forms import NewjobForm +from .models import Newjob + + +# Create your views here. +def create(request): + if request.method == "POST": + form = NewjobForm(request.POST, request.FILES) + if form.is_valid(): + form.save() + return redirect('read.newjob') + return render(request, 'job/create.html') + + +def read(request): + jobs = Newjob.objects.all() + return render(request, 'job/read.html', {'jobs': jobs}) + + +def update(request, job_id): + job = Newjob.objects.get(id=job_id) + if request.method == "POST": + form = NewjobForm(request.POST, request.FILES, instance=job) + if form.is_valid(): + form.save() + return redirect('read.newjob') + return render(request, 'job/update.html', {'job': job}) + + +def delete(request, job_id): + job = Newjob.objects.get(id=job_id) + job.delete() + return redirect('read.newjob') diff --git a/python b/python new file mode 100644 index 0000000..e69de29 diff --git a/static/newjob/images/Screenshot_107.png b/static/newjob/images/Screenshot_107.png new file mode 100644 index 0000000..789b884 Binary files /dev/null and b/static/newjob/images/Screenshot_107.png differ diff --git a/static/newjob/images/Screenshot_134.png b/static/newjob/images/Screenshot_134.png new file mode 100644 index 0000000..ca688e0 Binary files /dev/null and b/static/newjob/images/Screenshot_134.png differ diff --git a/static/newjob/images/Screenshot_134_g3WeTWc.png b/static/newjob/images/Screenshot_134_g3WeTWc.png new file mode 100644 index 0000000..ca688e0 Binary files /dev/null and b/static/newjob/images/Screenshot_134_g3WeTWc.png differ diff --git a/static/newjob/images/Screenshot_14.png b/static/newjob/images/Screenshot_14.png new file mode 100644 index 0000000..b8026cf Binary files /dev/null and b/static/newjob/images/Screenshot_14.png differ diff --git a/static/newjob/images/Screenshot_3.png b/static/newjob/images/Screenshot_3.png new file mode 100644 index 0000000..dba53f2 Binary files /dev/null and b/static/newjob/images/Screenshot_3.png differ diff --git a/static/newjob/images/Screenshot_3_U2m1GSN.png b/static/newjob/images/Screenshot_3_U2m1GSN.png new file mode 100644 index 0000000..dba53f2 Binary files /dev/null and b/static/newjob/images/Screenshot_3_U2m1GSN.png differ diff --git a/static/newjob/images/Screenshot_4.png b/static/newjob/images/Screenshot_4.png new file mode 100644 index 0000000..30861d8 Binary files /dev/null and b/static/newjob/images/Screenshot_4.png differ