Skip to content

Commit

Permalink
fixing lint ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
roniahmadi committed Oct 5, 2024
1 parent 2b0ea76 commit 99ef6c9
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 25 deletions.
1 change: 0 additions & 1 deletion frontend/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@
),
path("toko/<int:id>/transaksi/", TransaksiToko.as_view(), name="transaksi_toko"),
path("toko/transaksi/<int:id>/report", ReportToko.as_view(), name="toko_laporkan"),

# user
path("user/withdrawl/", Withdrawl.as_view(), name="withdrawl"),
path(
Expand Down
1 change: 0 additions & 1 deletion master/admin_view/distric.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ class Meta:

class DistricAdmin(ImportExportModelAdmin):
resource_classes = [DistricResource]

1 change: 0 additions & 1 deletion master/admin_view/provinsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ class Meta:

class ProvinsiAdmin(ImportExportModelAdmin):
resource_classes = [ProvinsiResource]

1 change: 0 additions & 1 deletion master/admin_view/regency.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ class Meta:

class RegencyAdmin(ImportExportModelAdmin):
resource_classes = [RegencyResource]

2 changes: 1 addition & 1 deletion master/admin_view/region.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ class Meta:


class RegionAdmin(ImportExportModelAdmin):
resource_classes = [RegionResource]
resource_classes = [RegionResource]
2 changes: 1 addition & 1 deletion master/admin_view/subregion.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ class Meta:


class SubRegionAdmin(ImportExportModelAdmin):
resource_classes = [SubRegionResource]
resource_classes = [SubRegionResource]
2 changes: 1 addition & 1 deletion master/admin_view/village.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ class Meta:


class VillageAdmin(ImportExportModelAdmin):
resource_classes = [VillageResource]
resource_classes = [VillageResource]
2 changes: 1 addition & 1 deletion master/models/configuration_website.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ class ConfigurationWebsite(SingletonModel):

api_biteship = models.CharField(blank=True, null=True, max_length=255)
verification = models.CharField(blank=True, null=True, max_length=255)
bypass_expedisi = models.BooleanField(default=False)
bypass_expedisi = models.BooleanField(default=False)
1 change: 0 additions & 1 deletion master/models/expedisi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ class Expedisi(models.Model):

def __str__(self):
return self.nama

2 changes: 1 addition & 1 deletion master/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SOURCE_REQUEST = [
(1, "Raja Ongkir"),
(2, "Biteship"),
]
]
57 changes: 45 additions & 12 deletions transaction/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
from transaction.utils import TYPE, TYPE_CART_ITEM, STATUS, STATUS_TOKO
from master.utils import SOURCE_REQUEST


# Creating Backup User
class TransactionUser(models.Model):
user = models.ForeignKey(UserProfile, null=True, on_delete=models.SET_NULL, related_name="transaction_origin_user_cart")
user = models.ForeignKey(
UserProfile, null=True, on_delete=models.SET_NULL, related_name="transaction_origin_user_cart"
)
first_name = models.CharField(max_length=255, blank=True, null=True)
last_name = models.CharField(max_length=255, blank=True, null=True)
image_profile = models.ImageField(upload_to="transaction_profile_img/", blank=True, null=True)
Expand All @@ -32,8 +35,12 @@ class TransactionUser(models.Model):

# Creating Backup Store
class TransactionUserStore(models.Model):
store = models.ForeignKey(UserStore, on_delete=models.SET_NULL, null=True, related_name="transaction_transactionuserstore_store")
users = models.ForeignKey(TransactionUser, on_delete=models.SET_NULL, null=True, related_name="transaction_user_store")
store = models.ForeignKey(
UserStore, on_delete=models.SET_NULL, null=True, related_name="transaction_transactionuserstore_store"
)
users = models.ForeignKey(
TransactionUser, on_delete=models.SET_NULL, null=True, related_name="transaction_user_store"
)
nama = models.TextField(null=False, blank=False)
coin = models.FloatField(default=0)
deskripsi = models.TextField(null=True, blank=True)
Expand All @@ -49,7 +56,13 @@ def __str__(self) -> str:

# Creating Addres for user
class AddressUserChart(models.Model):
user = models.ForeignKey(TransactionUser, on_delete=models.CASCADE, null=True, blank=True, related_name="transaction_addressuserchart_user")
user = models.ForeignKey(
TransactionUser,
on_delete=models.CASCADE,
null=True,
blank=True,
related_name="transaction_addressuserchart_user",
)
typeaddress = models.IntegerField(choices=TYPE_CART_ITEM, default=1)

name = models.CharField(max_length=255)
Expand All @@ -66,7 +79,7 @@ class AddressUserChart(models.Model):

def __str__(self):
return self.address


# Creating Backup Produk Katgori
class CartProdukKategori(models.Model):
Expand All @@ -76,7 +89,7 @@ class CartProdukKategori(models.Model):

def __str__(self) -> str:
return self.kode


class CartProdukTipe(models.Model):
nama = models.CharField(blank=True, null=True, max_length=255)
Expand All @@ -93,15 +106,21 @@ def __str__(self):


class CartProduk(models.Model):
store = models.ForeignKey(TransactionUserStore, null=True, on_delete=models.SET_NULL, related_name="transaction_cartproduk_store")
produk = models.ForeignKey(Produk, null=True, on_delete=models.SET_NULL, related_name="transaction_cartproduk_produk")
store = models.ForeignKey(
TransactionUserStore, null=True, on_delete=models.SET_NULL, related_name="transaction_cartproduk_store"
)
produk = models.ForeignKey(
Produk, null=True, on_delete=models.SET_NULL, related_name="transaction_cartproduk_produk"
)

nama = models.TextField(null=True, blank=True)
harga = models.FloatField(null=True, blank=True)
kategori = models.ManyToManyField(CartProdukKategori)
detail = models.TextField(null=True, blank=True)

tipe = models.ForeignKey(CartProdukTipe, blank=True, null=True, on_delete=models.SET_NULL, related_name="transaction_cartproduk_tipe")
tipe = models.ForeignKey(
CartProdukTipe, blank=True, null=True, on_delete=models.SET_NULL, related_name="transaction_cartproduk_tipe"
)
warna = models.ManyToManyField(CartProdukWarna, blank=True, null=True, related_name="transaction_cartproduk_warna")
stok_produk = models.IntegerField(default=0)
is_active = models.BooleanField(default=True)
Expand Down Expand Up @@ -169,9 +188,23 @@ class CartItem(models.Model):
unique_cart = models.CharField(max_length=50, blank=True, null=True)
cart = models.ForeignKey(Cart, on_delete=models.SET_NULL, null=True, related_name="transaction_cartitem_cart")
jumlah = models.IntegerField(default=1)
produk = models.ForeignKey(CartProduk, null=True, on_delete=models.SET_NULL, related_name="transaction_cartitem_produk")
user_chart = models.ForeignKey(TransactionUser, blank=True, null=True, on_delete=models.SET_NULL, related_name="transaction_cartitem_user_chart")
store_chart = models.ForeignKey(TransactionUserStore, blank=True, null=True, on_delete=models.SET_NULL, related_name="transaction_cartitem_store_chart")
produk = models.ForeignKey(
CartProduk, null=True, on_delete=models.SET_NULL, related_name="transaction_cartitem_produk"
)
user_chart = models.ForeignKey(
TransactionUser,
blank=True,
null=True,
on_delete=models.SET_NULL,
related_name="transaction_cartitem_user_chart",
)
store_chart = models.ForeignKey(
TransactionUserStore,
blank=True,
null=True,
on_delete=models.SET_NULL,
related_name="transaction_cartitem_store_chart",
)

def __str__(self):
return " cart " + self.unique_cart
Expand Down
1 change: 0 additions & 1 deletion transaction/tests.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

# Create your tests here.
2 changes: 1 addition & 1 deletion transaction/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
]

STATUS = [(1, "Pending"), (2, "Diproses"), (3, "Selesai"), (4, "Confirm")]
STATUS_TOKO = [(1, "Pending"), (2, "Diproses"), (3, "Dikirim"), (4, "Confirm")]
STATUS_TOKO = [(1, "Pending"), (2, "Diproses"), (3, "Dikirim"), (4, "Confirm")]
1 change: 0 additions & 1 deletion transaction/views.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

# Create your views here.

0 comments on commit 99ef6c9

Please sign in to comment.