Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
30 changed files
with
589 additions
and
37 deletions.
There are no files selected for viewing
BIN
+16 KB
(110%)
EDMS/db.sqlite3
Binary file not shown.
BIN
+31 Bytes
(110%)
EDMS/shoppingCart/__pycache__/admin.cpython-38.pyc
Binary file not shown.
BIN
+481 Bytes
(120%)
EDMS/shoppingCart/__pycache__/models.cpython-38.pyc
Binary file not shown.
BIN
+152 Bytes
(140%)
EDMS/shoppingCart/__pycache__/urls.cpython-38.pyc
Binary file not shown.
BIN
+503 Bytes
(130%)
EDMS/shoppingCart/__pycache__/views.cpython-38.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import django_filters | ||
from .models import * | ||
|
||
|
||
|
||
class OrderFilter(django_filters.FilterSet): | ||
class Meta: | ||
model = Order | ||
fields = '__all__' | ||
exclude = ['store', 'date_created'] |
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,7 @@ | ||
from django.forms import ModelForm | ||
from .models import Store, Order | ||
|
||
class OrderForm(ModelForm): | ||
class Meta: | ||
model = Order | ||
fields = '__all__' |
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,24 @@ | ||
# Generated by Django 2.2.14 on 2020-10-17 13:25 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('shoppingCart', '0006_store_available'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Store_Order', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('date_created', models.DateTimeField(auto_now_add=True, null=True)), | ||
('status', models.CharField(choices=[('Pending', 'Pending'), ('Out for delivery', 'Out for delivery'), ('Delivered', 'Delivered')], max_length=200, null=True)), | ||
('product', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='shoppingCart.Product')), | ||
('store', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='shoppingCart.Store')), | ||
], | ||
), | ||
] |
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,37 @@ | ||
# Generated by Django 2.2.14 on 2020-10-17 14:04 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('shoppingCart', '0007_store_order'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='store_order', | ||
name='date_created', | ||
), | ||
migrations.RemoveField( | ||
model_name='store_order', | ||
name='status', | ||
), | ||
migrations.AddField( | ||
model_name='store_order', | ||
name='order', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='shoppingCart.Order'), | ||
), | ||
migrations.AddField( | ||
model_name='store_order', | ||
name='quantity', | ||
field=models.IntegerField(blank=True, default=0, null=True), | ||
), | ||
migrations.AlterField( | ||
model_name='store_order', | ||
name='product', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='shoppingCart.Product'), | ||
), | ||
] |
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,22 @@ | ||
# Generated by Django 2.2.14 on 2020-10-17 14:26 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('shoppingCart', '0008_auto_20201017_1504'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='store_order', | ||
name='order', | ||
), | ||
migrations.AddField( | ||
model_name='store_order', | ||
name='status', | ||
field=models.CharField(choices=[('Pending', 'Pending'), ('Out for delivery', 'Out for delivery'), ('Delivered', 'Delivered')], max_length=200, null=True), | ||
), | ||
] |
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,18 @@ | ||
# Generated by Django 2.2.14 on 2020-10-17 14:28 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('shoppingCart', '0009_auto_20201017_1526'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='store_order', | ||
name='date_created', | ||
field=models.DateTimeField(auto_now_add=True, null=True), | ||
), | ||
] |
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,17 @@ | ||
# Generated by Django 3.1.2 on 2020-10-19 16:09 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('shoppingCart', '0010_store_order_date_created'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameModel( | ||
old_name='Store_Order', | ||
new_name='StoreOrder', | ||
), | ||
] |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{% extends 'shoppingCart/store_dashBoard.html' %} | ||
{% block content %} | ||
|
||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title></title> | ||
</head> | ||
<body> | ||
|
||
</body> | ||
</html> | ||
{% endblock content %} |
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,22 @@ | ||
{% extends 'shoppingCart/store_dashBoard.html' %} | ||
{% block content %} | ||
|
||
|
||
<br> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
<div class="card card-body"> | ||
|
||
<p>Are you sure you want to delete "{{item}}"?</p> | ||
<form action="" method="post"> | ||
{% csrf_token %} | ||
<a class="btn btn-warning" href="{{request.META.HTTP_REFERER}}">Go back</a> | ||
|
||
<input class="btn btn-danger" type="submit"/> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
{% endblock content %} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{% load static %} | ||
<!DOCTYPE html> | ||
<html lang="zxx"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="description" content="Ogani Template"> | ||
<meta name="keywords" content="Ogani, unica, creative, html"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>Limit Items bought per Week</title> | ||
|
||
<!-- Google Font --> | ||
<link href="https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;600;900&display=swap" rel="stylesheet"> | ||
|
||
<!-- Css Styles --> | ||
<link rel="stylesheet" href="{% static '/css/bootstrap.min.css'%}" type="text/css"> | ||
<link rel="stylesheet" href="{% static '/css/font-awesome.min.css'%}" type="text/css"> | ||
<link rel="stylesheet" href="{% static '/css/elegant-icons.css'%}" type="text/css"> | ||
<link rel="stylesheet" href="{% static '/css/nice-select.css'%}" type="text/css"> | ||
<link rel="stylesheet" href="{% static '/css/jquery-ui.min.css'%}" type="text/css"> | ||
<link rel="stylesheet" href="{% static '/css/owl.carousel.min.css'%}" type="text/css"> | ||
<link rel="stylesheet" href="{% static '/css/slicknav.min.css'%}" type="text/css"> | ||
<link rel="stylesheet" href="{% static '/css/style.css'%}" type="text/css"> | ||
|
||
<!-- CSRF Token --> | ||
<script type="text/javascript"> | ||
var user = '{{request.user}}' | ||
|
||
function getToken(name) { | ||
let cookieValue = null; | ||
if (document.cookie && document.cookie !== '') { | ||
const cookies = document.cookie.split(';'); | ||
for (let i = 0; i < cookies.length; i++) { | ||
const cookie = cookies[i].trim(); | ||
// Does this cookie string begin with the name we want? | ||
if (cookie.substring(0, name.length + 1) === (name + '=')) { | ||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); | ||
break; | ||
} | ||
} | ||
} | ||
return cookieValue; | ||
} | ||
const csrftoken = getToken('csrftoken'); | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<header class="header"> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-lg-3"> | ||
<div class="header__logo"> | ||
<a href="{% url 'main' %}"><img src="{% static '/images/logo.png'%}" alt=""></a> | ||
</div> | ||
</div> | ||
<div class="col-lg-9"> | ||
<nav class="header__menu"> | ||
<ul> | ||
<li class="active"><a href="{% url 'store_dashBoard' %}">Dashboard </a></li> | ||
<li><a href="{% url 'products' %}">Products</a></li> | ||
<li><a href="#">Suplier realocation of resources</a></li> | ||
</ul> | ||
</nav> | ||
</div> | ||
</div> | ||
<div class="humberger__open"> | ||
<form class="form-inline"> | ||
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search"> | ||
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button> | ||
</form> | ||
<i class="fa fa-bars"></i> | ||
</div> | ||
</div> | ||
</header> | ||
|
||
</html > | ||
|
||
|
||
|
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,37 @@ | ||
{% extends 'shoppingCart/store_dashBoard.html' %} | ||
{% load static %} | ||
{% block content %} | ||
{% load widget_tweaks %} | ||
|
||
|
||
<div class="row"> | ||
<div class="col-md-6"> | ||
<div class="card card-body"> | ||
{% if action == 'create' %} | ||
<h3>Create Shop Order</h3> | ||
{% elif action == 'update' %} | ||
<h3>Update Shop Order</h3> | ||
{% endif %} | ||
|
||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-md-6"> | ||
<div class="card card-body"> | ||
<form action="" method="POST"> | ||
{% csrf_token %} | ||
{% for field in form %} | ||
{{field.label}} | ||
{{field|add_class:'form-control'}} | ||
|
||
{% endfor %} | ||
<hr> | ||
<input type="submit" class="btn btn-info"> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{% endblock %} |
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,30 @@ | ||
{% extends 'shoppingCart/store_dashBoard.html' %} | ||
{% block content %} | ||
|
||
<br> | ||
|
||
<div class="row"> | ||
<div class="col-md"> | ||
<div class="card card-body"> | ||
</div> | ||
<div class="card card-body"> | ||
<table class="table"> | ||
<tr> | ||
<th>Product</th> | ||
|
||
<th>Price</th> | ||
</tr> | ||
{% for product in products %} | ||
<tr> | ||
<td>{{product.name}}</td> | ||
|
||
<td>${{product.price}}</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
{% endblock content %} |
Oops, something went wrong.