-
Notifications
You must be signed in to change notification settings - Fork 3
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
roniahmadi
committed
Feb 29, 2024
1 parent
e030713
commit 726548e
Showing
101 changed files
with
109 additions
and
89 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 |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
*node_modules | ||
mysql | ||
.env | ||
**/__pycache__/ | ||
**/__pycache__ |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-184 Bytes
(95%)
apidata/serializers/__pycache__/auth_serializer.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-16 Bytes
(100%)
apidata/serializers/__pycache__/produks_serializer.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
apidata/serializers/__pycache__/slides_serializer.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-190 Bytes
(88%)
apidata/serializers/__pycache__/stores_serializer.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-22 Bytes
(99%)
apidata/serializers/__pycache__/ulasan_serializer.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-199 Bytes
(93%)
apidata/viewsets/__pycache__/produks_viewset.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-139 Bytes
(87%)
apidata/viewsets/__pycache__/slides_viewset.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-139 Bytes
(90%)
apidata/viewsets/__pycache__/stores_viewset.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
apidata/viewsets/__pycache__/ulasan_viewset.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+6 Bytes
(100%)
frontend/function_view/__pycache__/base_view.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+73 Bytes
(110%)
frontend/function_view/__pycache__/detail_view.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+2 Bytes
(100%)
frontend/function_view/__pycache__/fcm_save_token.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+17 Bytes
(100%)
frontend/function_view/__pycache__/keranjang_add_view.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
frontend/function_view/__pycache__/koleksi_view.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
frontend/function_view/__pycache__/list_produk_toko_view.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
frontend/function_view/__pycache__/login_user_view.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
frontend/function_view/__pycache__/masuk_view.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-20 Bytes
(99%)
frontend/function_view/__pycache__/produk_view.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
frontend/function_view/__pycache__/profile_edit_view.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
frontend/function_view/__pycache__/save_token_views.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-9 Bytes
(99%)
frontend/function_view/__pycache__/search_produk_view.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-6 Bytes
(99%)
frontend/function_view/__pycache__/service_worker.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
frontend/function_view/__pycache__/toko_view.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-22 Bytes
(99%)
frontend/function_view/__pycache__/transaksi_user_count_json_view.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-114 Bytes
(94%)
frontend/function_view/__pycache__/transaksi_user_json_view.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+25 Bytes
(100%)
frontend/function_view/__pycache__/transaksi_user_view.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-65 Bytes
(96%)
frontend/function_view/__pycache__/translated_view.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-246 Bytes
(92%)
frontend/function_view/__pycache__/withdrawl_proccess_view.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-73 Bytes
(97%)
frontend/function_view/__pycache__/withdrawl_request_json_view.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
frontend/function_view/__pycache__/withdrawl_view.cpython-311.pyc
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from .base_view import FrontPage | ||
from django.http import JsonResponse | ||
from django.utils.decorators import method_decorator | ||
from django.views.decorators.csrf import csrf_exempt | ||
|
||
|
||
@method_decorator(csrf_exempt, name="dispatch") | ||
class UploadDropzone(FrontPage): | ||
def get(self, request): | ||
return JsonResponse({"status": True, "uuid": "1"}) |
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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
from django.urls import reverse | ||
from django.shortcuts import redirect, render | ||
from django.utils.decorators import method_decorator | ||
from django.views.decorators.csrf import csrf_exempt | ||
from django.contrib.auth.decorators import login_required | ||
from django.contrib import messages | ||
from .base_view import FrontPage | ||
from store.models import UserStore | ||
from produk.models import ( | ||
Kategori, | ||
WarnaProduk, | ||
TipeProduk, | ||
Expedisi, | ||
GambarProduk, | ||
Produk | ||
) | ||
|
||
|
||
@method_decorator(csrf_exempt, name="dispatch") | ||
@method_decorator(login_required(login_url="/profile"), name="dispatch") | ||
class Jual(FrontPage): | ||
def get(self, request): | ||
user = UserStore.objects.filter(users_id=request.user.id) | ||
if user.exists(): | ||
user = user.first() | ||
if user.is_active_store is False: | ||
return redirect(reverse("profile")) | ||
kategori = Kategori.objects.all() | ||
typeproduk = TipeProduk.objects.all() | ||
warnaproduk = WarnaProduk.objects.all() | ||
expedisi = Expedisi.objects.all() | ||
return render( | ||
request, | ||
"jualpage.html", | ||
{ | ||
"kategori": kategori, | ||
"typeproduk": typeproduk, | ||
"warnaproduk": warnaproduk, | ||
"ekspedisi": expedisi, | ||
}, | ||
) | ||
|
||
def post(self, request): | ||
refinput = request.POST | ||
reffile = request.FILES | ||
store = None | ||
try: | ||
store = UserStore.objects.get(users__pk=request.user.id) | ||
except Exception as e: | ||
print(e) | ||
store = UserStore.objects.create( | ||
users=request.user, nama=request.user.username | ||
) | ||
|
||
try: | ||
produk = Produk.objects.get( | ||
store__id=store.id, nama=refinput.get("nama", "") | ||
) | ||
messages.error(request, "Produk sudah ada") | ||
except Exception as e: | ||
print(e) | ||
produk = Produk.objects.create( | ||
store=store, | ||
nama=refinput.get("nama", ""), | ||
harga=refinput.get("harga", 1), | ||
detail=refinput.get("deskripsi", "-"), | ||
stok_produk=refinput.get("stok", 1), | ||
berat=refinput.get("berat"), | ||
lebar=refinput.get("lebar"), | ||
cross_boarder=refinput.get("lintas_negara", False), | ||
) | ||
for k in refinput.getlist("kategori"): | ||
kateg = Kategori.objects.filter(pk=k).first() | ||
produk.kategori.add(kateg) | ||
|
||
for k in refinput.getlist("warna"): | ||
try: | ||
warnaa = WarnaProduk.objects.filter(pk=k).first() | ||
except Exception as e: | ||
print(e) | ||
warnaa = WarnaProduk.objects.filter(nama=k).first() | ||
if warnaa: | ||
produk.warna.add(warnaa) | ||
else: | ||
warnaa = WarnaProduk.objects.create(nama=k) | ||
produk.warna.add(warnaa) | ||
|
||
tipes = TipeProduk.objects.filter(pk=refinput.get("tipe")).first() | ||
produk.tipe.add(tipes) | ||
# print(reffile.get("gambar")) | ||
for reffiles in reffile.getlist("gambar"): | ||
GambarProduk.objects.create( | ||
produk=produk, nama=refinput.get("nama", "-"), gambar=reffiles | ||
) | ||
messages.success(request, "Produk Berhasil disimpan") | ||
return redirect(reverse("jual")) |
Binary file modified
BIN
+14 Bytes
(100%)
frontend/migrations/__pycache__/0001_initial.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+14 Bytes
(100%)
frontend/migrations/__pycache__/0002_contenttranslate.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
frontend/migrations/__pycache__/0003_contenttranslate_lang.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
frontend/migrations/__pycache__/0004_alter_contenttranslate_tag_data.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+2 Bytes
(100%)
frontend/templatetags/__pycache__/translater.cpython-311.pyc
Binary file not shown.
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+116 Bytes
(100%)
master/migrations/__pycache__/0001_initial.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+272 Bytes
(100%)
produk/migrations/__pycache__/0001_initial.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+103 Bytes
(100%)
produk/migrations/__pycache__/0002_initial.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+9 Bytes
(100%)
produk/migrations/__pycache__/0003_cart_expoedisi.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
produk/migrations/__pycache__/0004_rename_expoedisi_cart_expedisi.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-4 Bytes
(100%)
produk/migrations/__pycache__/0005_alter_addressuserchartitem_userprofile.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
produk/migrations/__pycache__/0006_gambarproduk_sortings.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-17 Bytes
(99%)
...igrations/__pycache__/0007_produk_cross_boarder_alter_gambarproduk_gambar.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+15 Bytes
(100%)
profiles/migrations/__pycache__/0001_initial.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
profiles/migrations/__pycache__/0002_userprofile_fcm_token.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+20 Bytes
(100%)
profiles/migrations/__pycache__/0003_userwithdrawltransactionrequest.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+14 Bytes
(100%)
profiles/migrations/__pycache__/0004_langsupport.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-4 Bytes
(100%)
profiles/migrations/__pycache__/0005_userprofile_languages.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
profiles/migrations/__pycache__/0006_langsupport_is_active.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-24 Bytes
(98%)
profiles/migrations/__pycache__/0007_userprofileaddress_image_profile.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
-24 Bytes
(98%)
...rations/__pycache__/0008_remove_userprofileaddress_image_profile_and_more.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+126 Bytes
(100%)
store/migrations/__pycache__/0001_initial.cpython-311.pyc
Binary file not shown.
Binary file modified
BIN
+14 Bytes
(100%)
store/migrations/__pycache__/0002_expedisi.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.