Compare commits

..

No commits in common. "ebb48c1a420264eb53495682e2c12a5328e1189a" and "8f6f226654fc20a38c08aa07366d3e744c6d8cb6" have entirely different histories.

11 changed files with 13 additions and 169 deletions

View File

@ -11,8 +11,3 @@ The AHosking.com API
1. Activate environment 1. Activate environment
`.\.env\Scripts\activate` `.\.env\Scripts\activate`
1. 1.
### Third-party
* https://pypi.org/project/django-3-jet/

View File

@ -4,26 +4,5 @@
"path": "." "path": "."
} }
], ],
"settings": { "settings": {}
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#fbed80",
"activityBar.activeBorder": "#06b9a5",
"activityBar.background": "#fbed80",
"activityBar.foreground": "#15202b",
"activityBar.inactiveForeground": "#15202b99",
"activityBarBadge.background": "#06b9a5",
"activityBarBadge.foreground": "#15202b",
"sash.hoverBorder": "#fbed80",
"statusBar.background": "#f9e64f",
"statusBar.foreground": "#15202b",
"statusBarItem.hoverBackground": "#f7df1e",
"statusBarItem.remoteBackground": "#f9e64f",
"statusBarItem.remoteForeground": "#15202b",
"titleBar.activeBackground": "#f9e64f",
"titleBar.activeForeground": "#15202b",
"titleBar.inactiveBackground": "#f9e64f99",
"titleBar.inactiveForeground": "#15202b99"
},
"peacock.color": "#f9e64f"
}
} }

View File

@ -1,34 +0,0 @@
from django.utils.translation import ugettext_lazy as _
from jet.dashboard import modules
from jet.dashboard.dashboard import Dashboard, AppIndexDashboard
class CustomIndexDashboard(Dashboard):
# app_label = "api"
columns = 3
def init_with_context(self, context):
self.available_children.append(modules.LinkList)
self.children.append(modules.LinkList(
_('Support'),
children=[
{
'title': _('Django documentation'),
'url': 'http://docs.djangoproject.com/',
'external': True,
},
{
'title': _('Django "django-users" mailing list'),
'url': 'http://groups.google.com/group/django-users',
'external': True,
},
{
'title': _('Django irc channel'),
'url': 'irc://irc.freenode.net/django',
'external': True,
},
],
column=0,
order=0
))

View File

@ -29,15 +29,13 @@ SECRET_KEY = env("SECRET_KEY", default='django-insecure-7uajhmbt^@)mklk1ur=slkmn
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = env("DEBUG") DEBUG = env("DEBUG")
ALLOWED_HOSTS = ["localhost", "127.0.0.1", "192.168.1.187", "192.168.1.23"] ALLOWED_HOSTS = ["127.0.0.1", "192.168.1.187", "192.168.1.23"]
# Application definition # Application definition
INSTALLED_APPS = [ INSTALLED_APPS = [
'jet.dashboard',
'jet', 'jet',
'bills.apps.BillsConfig',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
@ -47,6 +45,7 @@ INSTALLED_APPS = [
'rest_framework', 'rest_framework',
'rest_framework.authtoken', 'rest_framework.authtoken',
'django_filters', 'django_filters',
'bills.apps.BillsConfig',
] ]
MIDDLEWARE = [ MIDDLEWARE = [
@ -137,40 +136,3 @@ STATIC_URL = '/static/'
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
JET_THEMES = [
{
'theme': 'default', # theme folder name
'color': '#47bac1', # color of the theme's button in user menu
'title': 'Default' # theme title
},
{
'theme': 'green',
'color': '#44b78b',
'title': 'Green'
},
{
'theme': 'light-green',
'color': '#2faa60',
'title': 'Light Green'
},
{
'theme': 'light-violet',
'color': '#a464c4',
'title': 'Light Violet'
},
{
'theme': 'light-blue',
'color': '#5EADDE',
'title': 'Light Blue'
},
{
'theme': 'light-gray',
'color': '#222',
'title': 'Light Gray'
}
]
# JET_INDEX_DASHBOARD = 'jet.dashboard.dashboard.DefaultIndexDashboard'
# JET_APP_INDEX_DASHBOARD = 'dashboard.CustomIndexDashboard'
JET_INDEX_DASHBOARD = 'dashboard.CustomIndexDashboard'

View File

@ -24,10 +24,7 @@ urlpatterns = [
# url(r'^$', view=TemplateView.as_view(template_name='bills/home.html')), # url(r'^$', view=TemplateView.as_view(template_name='bills/home.html')),
# url(r'^$', view=TemplateView.as_view(template_name='main_api/home.html')), # url(r'^$', view=TemplateView.as_view(template_name='main_api/home.html')),
path('', views.index, name='index'), path('', views.index, name='index'),
# url(r'^jet/', include('jet.urls', 'jet')), # Django JET URLS
# url(r'^jet/dashboard/', include('jet.dashboard.urls', 'jet-dashboard')),
path('jet/', include('jet.urls', 'jet')), path('jet/', include('jet.urls', 'jet')),
path('jet/dashboard', include('jet.dashboard.urls', 'jet-dashboard')),
path('bills/', include('bills.urls')), path('bills/', include('bills.urls')),
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
] ]

View File

@ -2,8 +2,4 @@ from django.contrib import admin
from .models import Bill from .models import Bill
@admin.register(Bill) admin.site.register(Bill)
class BillAdmin(admin.ModelAdmin):
list_display = ['name', 'due', 'amount']
list_filter = ('name', 'type', 'is_paid', 'is_overdue', 'is_missed')
search_fields = ['name', 'type', 'amount']

View File

@ -1,48 +0,0 @@
# Generated by Django 3.2.9 on 2021-12-03 20:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bills', '0003_alter_bill_paid_date'),
]
operations = [
migrations.AlterField(
model_name='bill',
name='due',
field=models.DateField(verbose_name='Due Date'),
),
migrations.AlterField(
model_name='bill',
name='is_missed',
field=models.BooleanField(default=False, verbose_name='Missed Payment'),
),
migrations.AlterField(
model_name='bill',
name='is_overdue',
field=models.BooleanField(default=False, verbose_name='Overdue'),
),
migrations.AlterField(
model_name='bill',
name='is_paid',
field=models.BooleanField(default=False, verbose_name='Paid'),
),
migrations.AlterField(
model_name='bill',
name='name',
field=models.CharField(max_length=64, verbose_name='Name'),
),
migrations.AlterField(
model_name='bill',
name='paid_date',
field=models.DateField(blank=True, null=True, verbose_name='Paid Date'),
),
migrations.AlterField(
model_name='bill',
name='type',
field=models.CharField(max_length=64, verbose_name='Type'),
),
]

View File

@ -2,14 +2,14 @@ from django.db import models
# Create your models here. # Create your models here.
class Bill(models.Model): class Bill(models.Model):
name = models.CharField(max_length=64, verbose_name='Name') name = models.CharField(max_length=64)
type = models.CharField(max_length=64, verbose_name="Type") type = models.CharField(max_length=64)
due = models.DateField(verbose_name="Due Date") due = models.DateField('due_date')
amount = models.FloatField(default='00.00') amount = models.FloatField(default='00.00')
is_paid = models.BooleanField(default=False, verbose_name="Paid") is_paid = models.BooleanField(default=False)
paid_date = models.DateField('Paid Date',null=True, blank=True) paid_date = models.DateField('paid_date',null=True, blank=True)
is_overdue = models.BooleanField(default=False, verbose_name="Overdue") is_overdue = models.BooleanField(default=False)
is_missed = models.BooleanField(default=False, verbose_name='Missed Payment') is_missed = models.BooleanField(default=False)
def overdue(self): def overdue(self):
return self.is_overdue return self.is_overdue

View File

@ -8,6 +8,5 @@ from . import views
urlpatterns = [ urlpatterns = [
path('', views.index, name='index'), path('', views.index, name='index'),
path('<int:bill_id>/', views.detail, name='detail') path('admin/', admin.site.urls),
# path('admin/', admin.site.urls),
] ]

View File

@ -3,6 +3,4 @@ from django.http import HttpResponse
def index(request): def index(request):
return HttpResponse("Let there be bills!") return HttpResponse("Let there be bills!")
# Create your views here.
def detail(request, bill_id):
return HttpResponse("You're looking at Bill %s." % bill_id)

Binary file not shown.