-
Notifications
You must be signed in to change notification settings - Fork 6
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
affe0cb
commit bec7a5f
Showing
4 changed files
with
122 additions
and
13 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,8 +1,32 @@ | ||
from django.contrib import admin | ||
from . models import Fees | ||
from . models import Fees, BilldeskOrders, BilldeskTransactions | ||
from import_export.admin import ExportActionMixin | ||
|
||
class FeesAdmin(ExportActionMixin, admin.ModelAdmin): | ||
list_display = ['batch', 'total_fee'] | ||
|
||
class BilldeskOrdersAdmin(admin.ModelAdmin): | ||
list_display = ['order_id', 'bd_order_id', 'order_time', 'order_response'] | ||
|
||
# This will disbale add functionality | ||
def has_add_permission(self, request): | ||
return False | ||
|
||
# This will disable delete functionality | ||
def has_delete_permission(self, request, obj=None): | ||
return False | ||
|
||
class BilldeskTransactionsAdmin(admin.ModelAdmin): | ||
list_display = ['order_id', 'transaction_id', 'transaction_status', 'payment_method', 'transaction_time', 'transaction_response'] | ||
|
||
# This will disbale add functionality | ||
def has_add_permission(self, request): | ||
return False | ||
|
||
# This will disable delete functionality | ||
def has_delete_permission(self, request, obj=None): | ||
return False | ||
|
||
admin.site.register(Fees, FeesAdmin) | ||
admin.site.register(Fees, FeesAdmin) | ||
admin.site.register(BilldeskOrders, BilldeskOrdersAdmin) | ||
admin.site.register(BilldeskTransactions, BilldeskTransactionsAdmin) |
43 changes: 43 additions & 0 deletions
43
backend/fees/migrations/0002_billdeskorders_billdesktransactions.py
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,43 @@ | ||
# Generated by Django 4.2.6 on 2024-02-07 07:44 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('fees', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='BilldeskOrders', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('order_id', models.CharField(max_length=25)), | ||
('bd_order_id', models.CharField(max_length=25)), | ||
('order_time', models.DateTimeField(auto_now_add=True)), | ||
('order_response', models.TextField()), | ||
], | ||
options={ | ||
'verbose_name_plural': 'Billdesk Orders', | ||
'db_table': 'billdesk_orders', | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='BilldeskTransactions', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('order_id', models.CharField(max_length=25)), | ||
('transaction_id', models.CharField(max_length=25)), | ||
('transaction_status', models.CharField(max_length=25)), | ||
('payment_method', models.CharField(max_length=25)), | ||
('transaction_time', models.DateTimeField(auto_now_add=True)), | ||
('transaction_response', models.TextField()), | ||
], | ||
options={ | ||
'verbose_name_plural': 'Billdesk Transactions', | ||
'db_table': 'billdesk_transactions', | ||
}, | ||
), | ||
] |
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