Commit 35673d3f authored by Christine Dela Rosa's avatar Christine Dela Rosa

Merge with branch 'mate_devbranch', Add help page, Fix StartAuctionForm and DeleteItemForm

parents da314e13 c7bafd11
......@@ -36,7 +36,7 @@ ALLOWED_HOSTS = []
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.auth', # Login, logout
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
......@@ -133,5 +133,4 @@ MEDIA_ROOT = os.path.join(BASE_DIR, 'boodlesite\media')
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'boodlesite\static'),
]
]
\ No newline at end of file
......@@ -373,14 +373,6 @@ nav a {
align-items: center;
}
/* item detail view / add, edit item */
.item-image-container,
.item-form-container {
border: 2px solid black;
padding: 1rem;
}
/* ?USER'S PROFILE */
.profile-container {
display: flex;
......@@ -392,4 +384,120 @@ nav a {
.profile-element {
margin-top: .5rem;
margin-bottom: .5rem;
}
/*===== EDIT PROFILE FORM =====*/
.edit-profile-container {
margin: 0 auto;
padding: 1rem;
}
.profile-form-container{
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
padding: 3rem;
}
/* About Page*/
.about__container {
margin: 0 auto;
width: 90%;
}
.about__header{
text-align: center;
}
.about__blockone, .about__blocktwo, .about__blockthree {
display: flex;
justify-content: center;
padding: 2rem;
}
.block-explanation{
width: 70%;
border-radius: 20px;
border: 5px black solid;
padding: 20px;
margin: 10px;
}
.block-image, .row, .col {
text-align: center;
padding: 1rem;
}
.form-space, .button-space{
display: flex;
justify-content: center;
padding: 3rem;
}
/* Add Item */
.additem-container{
text-align: center;
}
/* item detail view / add, edit item */
.item-form-container {
padding: 1rem;
margin: 0 auto;
}
.storeform-header {
text-align: center;
}
/* girl help */
.help-header{
background-color: #4c9ed0;
border-radius: 7px 7px 5px 0px;
padding: 10px;
color: #fff;
text-align: center;
font-family: Archivo;
font-size: 20px;
}
.help-container{
width: 500px;
}
.help-container{
width: 800px;
margin: 100px auto;
background: #fff;
border-radius: 7px;
box-shadow: 1px 2px 4px rgba(0,0,0,.3);
}
.help-perq{
padding: 0px 20px 20px;
}
::-webkit-details-marker{
float: right;
margin-top: 3px;
}
.help-perq details{
background: #f6f6f6;
padding: 10px 20px;
border-radius: 7px;
margin-top: 20px;
font-family: Archivo;
font-size: 18px;
letter-spacing: 1px;
cursor: pointer;
}
.help-perq details summary{
outline: none;
}
.help-text {
font-size: 15px;
}
\ No newline at end of file
{% extends 'boodlesite\templates\base.html' %}
{% load static %}
{% block title %}Boodle Homepage{% endblock %}
{% block styles %}
{% endblock %}
{% block content %}
<div class="about__header">
<h1>About Boodle</h1>
</div>
<div class="about__container">
<!-- overview -->
<div class="about__blockone">
<div class="block-image">
<img src="../static/media/block_one_pic.jpg">
</div>
<div class="block-explanation">
<h3>What is Boodle?</h3>
<p>
Boodle aims to provide an online bidding platform for online users. Its services are tailored specifically to bidding services to make communication and purchsing facilitation easier between buyers and sellers. For buyers, the common practice of "paunahan" is made easy for sellers can track which user bid on what and prevents issues such as scamming by correctly identifying the user with the highest bid.
</p>
</div>
</div>
<!-- About the product -->
<div class="about__blocktwo">
<div class="block-explanation">
<h3>Mission-Vision</h3>
<p>
Our mission has been to improve current bidding platforms and to provide a space for auctioneers and consumers to interact freely.
Boodle aims to provide sellers with the appropriate tools to auction items and aims to provide buyers a reliable platform for placing
bids on auctioned items.
</p>
</div>
<div class="block-image">
<img src="../static/media/block_two_pic.jpg">
</div>
</div>
<!-- About the makers -->
<div class="about__blockthree">
<div class="block-explanation">
<h3>Who are we?</h3>
<p> The developers are Computer Science students from Ateneo de Manila University. They consider themselves online shopaholics and so they
decided to create a platform for online auctions.
</p>
</div>
</div>
<div class="block-image">
<div class="row">
<div class="col">
<h6>Carmina Atienza</h6>
<img src="../static/media/profile_pics/didz.jpg">
</div>
<div class="col">
<h6>Christine Dela Rosa</h6>
<img src="../static/media/profile_pics/tin.jpg">
</div>
</div>
<div class="row">
<div class="col">
<h6>Martina Reyes</h6>
<img src="../static/media/profile_pics/mate.jpg">
</div>
<div class="col">
<h6>Felizia Tiburcio</h6>
<img src="../static/media/profile_pics/felizia.jpg">
</div>
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
......@@ -9,32 +9,20 @@
{% block content %}
<div class="container">
<div class="additem-container">
<h1>{{ title }}</h1>
<div class="row">
<div class="col-lg-7 col-md-6">ITEM IMAGE CONTAINER
<div class="item-image-container"></div>
</div>
<div class=" col-lg-5 col-md-6">ITEM FORM CONTAINER
<form action="" method="POST">
{% csrf_token %}
<div class="item-form-container">
<form action="" method="POST">
{% csrf_token %}
{{ form.as_p }}
{{ form.as_p }}
</div>
<button type="submit" name="Add Item"> Add Item </button>
</form>
</div>
</div>
</div>
<!-- Form with fields:
[Item name]
[Item Description]
[Floor Price] -->
<!-- Image, if no image add image -->
<div class="button-space">
<button type="button" class="btn btn-danger"><a href= "{% url 'storeid' request.user.id %}">Cancel</a></button>
<button type="submit" class="btn btn-dark" name="Add Item"> Add Item </button>
</div>
</form>
</div>
{% endblock %}
\ No newline at end of file
......@@ -76,7 +76,7 @@
{% if auction_bids %}
{% for bid in auction_bids %}
<li><img src="" alt="">
<p>{{bid.boodleuserid.displayname}} offered {{ bid.amount }}</p>
<p>{{bid.userid.username}} offered {{ bid.amount }}</p>
<p> &nbsp | &nbsp </p>
<p>{{bid.bidtime | timesince}} ago </p>
......
......@@ -32,15 +32,14 @@
<body>
<nav id="main">
<h1>Hello, {{request.user}}</h1>
<ul>
<li><a href="/">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Help</a></li>
<li><a href="/profile">My Profile</a></li>
<li><a href="/store">My Store</a></li>
<li><a href="{% url 'about' %}">About</a></li>
<li><a href="{% url 'help' %}">Help</a></li>
<li><a href="{% url 'profileid' request.user.id %}">My Profile</a></li>
<li><a href="{% url 'logout' %}">Logout</a></li>
</ul>
</nav>
......
......@@ -9,32 +9,21 @@
{% block content %}
<div class="container">
<h1>{{ title }}</h1>
<div class="row">
<div class="col-lg-7 col-md-6">ITEM IMAGE CONTAINER
<div class="item-image-container"></div>
</div>
<div class=" col-lg-5 col-md-6">ITEM FORM CONTAINER
<div class="item-form-container">
<form action="" method="POST">
{% csrf_token %}
{{ form.as_p }}
<div class="edit-profile-container">
<h1>{{ title }}</h1>
<div class="">
<div class="profile-form-container">
<form action="" method="POST">
{% csrf_token %}
{{ form.as_p }}
<div class="button-space">
<button type="button" class="btn btn-danger"><a href= "{% url 'profileid' request.user.id %}">Cancel</a></button>
<button class="profile-submit-button btn btn-dark" type="submit" name="Add Item"> Save Changes </button>
</div>
<button type="submit" name="Add Item"> Save Changes </button>
</form>
</div>
</div>
</div>
</div>
<!-- Form with fields:
[Item name]
[Item Description]
[Floor Price] -->
<!-- Image, if no image add image -->
{% endblock %}
\ No newline at end of file
{% extends 'boodlesite\templates\base.html' %}
{% load static %}
{% block title %}Profile{% endblock %}
{% block styles %}
{% endblock %}
{% block content %}
<div class="help-container">
<p class="help-header">FAQ</p>
<div class="help-perq">
<details>
<summary>Placing a Bid</summary>
<ul class="help-text">
<li>To place a bid, go to the homepage to check all on-going auctions </li>
<li>Find the desired auction and click on the title to go to the auction title</li>
<li>At the auction, click on the "Place Bid" button near the latest bids</li>
<li>A pop-up will appear, enter the a desired bidding value in the input box
<br> *Please note: only bids higher than the current highest bid will go through</li>
<li>Once you place the desired bid, click submit and the bid should appear in latest bid</li>
</ul>
</details>
<details>
<summary>Creating a Store</summary>
<ul class="help-text">
<li>Access your profile by clicking the link "My Profile" on the nav bar </li>
<li>Once accessed, below your profile picture is the button "Create Store"</li>
<li>Click this button and a pop up will appear where you input the desired store information</li>
<li>Once you click "Submit", the button will change into a link to access your store</li>
</ul>
</details>
<details>
<summary>Inventory Management</summary>
<ul class="help-text">
<li>To access your store, click the "My Store" button on the profile page</li>
<li>At the store page, you can view the current items in your inventory </li>
<li>Each item has the option to edit and delete an item below the item name</li>
<li>To add an item, click the "Add Item" button at the bottom of the page</li>
<li>Once selected, you will be redirected to a page where you can input the necessary information for an item</li>
<li>Once filled, select "Add Item" button and the item should appear on your store page</li>
</ul>
</details>
<details>
<summary>Starting an Auction</summary>
<ul class="help-text">
<li>To access your store, click the "My Store" button on the profile page</li>
<li>To start an auction, select the "Start Auction" button at the bottom of the page
<br> *Note: You must have an existing item to start an auction and you cannot create duplicate auctions for a single item</li>
<li>Once selected, you will be redirected to a page where you can input the necessary information for the auction</li>
<li>Once filled, select "Start Auction" button and the auction should appear on the homepage</li>
</ul>
</details>
<details>
<summary>Profile Management</summary>
<ul class="help-text">
<li>Access your profile by clicking the link "My Profile" on the nav bar</li>
<li>Below the profile picture, there will be a button "Edit Profile"</li>
<li>Clicking this button, the you will be redirected to change your username</li>
<li>After filling it up and selecting "Save Changes". The changes will appear on the profile.</li>
</ul>
</details>
</div>
</div>
{% endblock %}
\ No newline at end of file
......@@ -68,7 +68,7 @@
<p>Boodle was founded by a group of four talented software engineers, who are currently Computer Science students
in Ateneo de Manila University. They believed they could change the status quo
of the e-commerce world—and with Boodle, they did. </p>
<button id="btn-read-more">Read more</button>
<button id="btn-read-more"><a href="{% url 'about' %}">Read more</a></button>
</div>
</div>
</div>
......
......@@ -22,7 +22,7 @@
<!--If a user owns a store, they can access the store-->
{% if store %}
<button type="button" class="btn btn-primary">
<a href= "{% url 'storeid' store %}" >
<a href= "{% url 'storeid' store %}" style="color: white" >
My Store
</a>
</button>
......@@ -33,7 +33,7 @@
{% endif %}
<button type="button" class="btn btn-primary">
<a href= "{% url 'editProfile' user %}" >
<a href= "{% url 'editProfile' user %}" style="color: white" >
Edit Profile
</a></button>
</div>
......@@ -61,9 +61,8 @@
<!--Change auctions_now, auction to like favorites, favorite-->
<h2> Items {{displayname}} bid on </h2>
<div class="event-container">
{% if auctionsOfUser %}
{% for id in idsOfAuction %}
{% if id.auctionend > currentdate %}
{% if auctions_of_user %}
{% for id in ids_of_auction %}
<div class="event">
<img src="http://via.placeholder.com/640x360" alt="">
<div class="event-text">
......@@ -73,7 +72,6 @@
<p>{{ id.auctionend }}</p>
</div>
</div>
{% endif %}
{% endfor %}
{% else %}
......
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" integrity="sha384-gfdkjb5BdAXd+lj+gudLWI+BXq4IuLW5IT+brZEZsLFm++aCMlF1V92rMkPaX4PP" crossorigin="anonymous">
<style>
body,
html {
margin: 0;
padding: 0;
height: 100%;
background: #7abecc !important;
}
.user_card {
width: 350px;
margin-top: auto;
margin-bottom: auto;
background: #74cfbf;
position: relative;
display: flex;
justify-content: center;
flex-direction: column;
padding: 10px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
-webkit-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
-moz-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-radius: 5px;
}
.form_container {
margin-top: 20px;
}
#form-title{
color: #fff;
}
.login_btn {
width: 100%;
background: #33ccff !important;
color: white !important;
}
.login_btn:focus {
box-shadow: none !important;
outline: 0px !important;
}
.login_container {
padding: 0 2rem;
}
.input-group-text {
background: #f7ba5b !important;
color: white !important;
border: 0 !important;
border-radius: 0.25rem 0 0 0.25rem !important;
}
.input_user,
.input_pass:focus {
box-shadow: none !important;
outline: 0px !important;
}
#messages{
background-color: grey;
color: #fff;
padding: 10px;
margin-top: 10px;
}
</style>
</head>
<body>
<div class="container h-100">
<div class="d-flex justify-content-center h-100">
<div class="user_card">
<div class="d-flex justify-content-center">
<h3 id="form-title">LOGIN</h3>
</div>
<div class="d-flex justify-content-center form_container">
<form method="POST" action="">
{% csrf_token %}
<div class="input-group mb-3">
<div class="input-group-append">
<span class="input-group-text"><i class="fas fa-user"></i></span>
</div>
<input type="text" name="username" placeholder="Username..." class="form-control">
</div>
<div class="input-group mb-2">
<div class="input-group-append">
<span class="input-group-text"><i class="fas fa-key"></i></span>
</div>
<input type="password" name="password" placeholder="Password..." class="form-control" >
</div>
<div class="d-flex justify-content-center mt-3 login_container">
<input class="btn login_btn" type="submit" value="Login">
</div>
</form>
</div>
{% for message in messages %}
<p id="messages">{{message}}</p>
{% endfor %}
<div class="mt-4">
<div class="d-flex justify-content-center links">
Don't have an account? <a href="{% url 'register' %}" class="ml-2">Sign Up</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" integrity="sha384-gfdkjb5BdAXd+lj+gudLWI+BXq4IuLW5IT+brZEZsLFm++aCMlF1V92rMkPaX4PP" crossorigin="anonymous">
<style>
body,
html {
margin: 0;
padding: 0;
height: 100%;
background: #7abecc !important;
}
.user_card {
width: 350px;
margin-top: auto;
margin-bottom: auto;
background: #74cfbf;
position: relative;
display: flex;
justify-content: center;
flex-direction: column;
padding: 10px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
-webkit-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
-moz-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-radius: 5px;
}
.form_container {
margin-top: 20px;
}
#form-title{
color: #fff;
}
.login_btn {
width: 100%;
background: #33ccff !important;
color: white !important;
}
.login_btn:focus {
box-shadow: none !important;
outline: 0px !important;
}
.login_container {
padding: 0 2rem;
}
.input-group-text {
background: #f7ba5b !important;
color: white !important;
border: 0 !important;
border-radius: 0.25rem 0 0 0.25rem !important;
}
.input_user,
.input_pass:focus {
box-shadow: none !important;
outline: 0px !important;
}
</style>
</head>
<body>
<div class="container h-100">
<div class="d-flex justify-content-center h-100">
<div class="user_card">
<div class="d-flex justify-content-center">
<h3 id="form-title">REGISTER ACCOUNT</h3>
</div>
<div class="d-flex justify-content-center form_container">
<form method="POST" action="">
{% csrf_token %}
<div class="input-group mb-3">
<div class="input-group-append">
<span class="input-group-text"><i class="fas fa-user"></i></span>
</div>
<input type="text" name="username">
</div>
<div class="input-group mb-2">
<div class="input-group-append">
<span class="input-group-text"><i class="fas fa-envelope-square"></i></span>
</div>
<input type="email" name="email">
</div>
<div class="input-group mb-2">
<div class="input-group-append">
<span class="input-group-text"><i class="fas fa-key"></i></span>
</div>
<input type="password" name="password1">
</div>
<div class="input-group mb-2">
<div class="input-group-append">
<span class="input-group-text"><i class="fas fa-key"></i></span>
</div>
<input type="password" name="password2">
</div>
<div class="d-flex justify-content-center mt-3 login_container">
<input class="btn login_btn" type="submit" value="Register Account">
</div>
</form>
</div>
<div class="mt-4">
<div class="d-flex justify-content-center links">
Already have an account? <a href="{% url 'login' %}" class="ml-2">Login</a>
</div>
</div>
</div>
</div>
</div>
<script>
/* Because i didnt set placeholder values in forms.py they will be set here using vanilla Javascript
//We start indexing at one because CSRF_token is considered and input field
*/
//Query All input fields
var form_fields = document.getElementsByTagName('input')
form_fields[1].placeholder='Username..';
form_fields[2].placeholder='Email..';
form_fields[3].placeholder='Enter password...';
form_fields[4].placeholder='Re-enter Password...';
for (var field in form_fields){
form_fields[field].className += ' form-control'
}
</script>
</body>
</html>
......@@ -9,18 +9,25 @@
{% block content %}
<div class="container">
<form action="" method="POST">
{% csrf_token %}
{{ form.as_p }}
<button type="submit" name="savesauction">Start Auction</button>
<div class="form-space">
{{ form.as_p }}
</div>
<div class="button-space">
<button type="button" class="btn btn-danger"><a href= "{% url 'storeid' request.user.id %}">Cancel</a></button>
<button type="submit" class="btn btn-dark" name="savesauction">Save Auction</button>
</div>
</form>
</div>
<input id="datetimepicker" type="text">
<script>
<!-- <script>
$(function () {
$("#id_auctionstart").datetimepicker();
});
......@@ -28,7 +35,7 @@
$(function () {
$("#id_auctionend").datetimepicker();
});
</script>
</script> -->
<!-- Form fields:
[Auction Title]
......
......@@ -10,31 +10,19 @@
{% block content %}
<div class="container">
<div class = "storeform-header">
<h1>{{ title }}</h1>
<div class="row">
<div class="col-lg-7 col-md-6">ITEM IMAGE CONTAINER
<div class="item-image-container"></div>
</div>
<div class=" col-lg-5 col-md-6">ITEM FORM CONTAINER
<div class="item-form-container">
<form action="" method="POST">
{% csrf_token %}
{{ form.as_p }}
</div>
<button type="submit" name="Add Item"> Save Changes </button>
</form>
</div>
</div>
<form action="" method="POST">
{% csrf_token %}
<div class="form-space">
{{ form.as_p }}
</div>
<div class="button-space">
<button type="button" class="btn btn-danger"><a href= "{% url 'storeid' request.user.id %}">Cancel</a></button>
<button type="submit" class="btn btn-dark" name="Add Item"> Save Changes </button>
</div>
</form>
</div>
<!-- Form with fields:
[Item name]
[Item Description]
[Floor Price] -->
<!-- Image, if no image add image -->
{% endblock %}
\ No newline at end of file
{% extends 'boodlesite\templates\base.html' %}
{% load static %}
{% block title %}My Profile{% endblock %}
{% block styles %}
{% endblock %}
{% block content %}
<h2>This is a temp page to access userid 1 (and not thru the navbar)</h2>
<p>Remove this page once nav bar is personalized that it
accesses the logged in user's profile</p>
<h1 text-align="center">Link to My Profile: <a href="{% url 'profileid' user_one.userid %}">{{ user_one.userid }}</a></h1>
<h1 text-align="center">Link to My OTHER Profile: <a href="{% url 'profileid' user_two.userid %}">{{user_two.userid}}</a></h1>
{% endblock %}
\ No newline at end of file
{% extends 'boodlesite\templates\base.html' %}
{% load static %}
{% block title %}My Store{% endblock %}
{% block styles %}
{% endblock %}
{% block content %}
<h2>This is a temp page to access storeid 1 (and not thru the navbar)</h2>
<p>Remove this page once nav bar is personalized that it accesses the logged in user's store</p>
<h1 text-align="center">Link to My Store: <a href="{% url 'storeid' current_store.storeid %}">{{ current_store.storename }}</a></h1>
{% endblock %}
\ No newline at end of file
......@@ -12,15 +12,18 @@ import datetime, pytz
from django.contrib.admin.widgets import AdminSplitDateTime
from django.contrib.admin import widgets
from django.contrib.auth.forms import UserCreationForm
from django import forms
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
class PlaceBidForm(forms.ModelForm):
class Meta:
model = AuctionBid
fields = ['amount', 'boodleuserid', 'auctionid']
fields = ['amount', 'userid', 'auctionid']
widgets = {'auctionid': forms.HiddenInput(),
'boodleuserid': forms.HiddenInput()
'userid': forms.HiddenInput()
}
def clean(self):
......@@ -62,10 +65,8 @@ class StartAuctionForm(forms.ModelForm):
# auctionstart = forms.SplitDateTimeField(widget=AdminSplitDateTime())
# auctionend = forms.SplitDateTimeField(widget=AdminSplitDateTime())
# auctionstart = forms.DateTimeField(input_formats=['%d/%m/%Y %H:%M'])
# auctionend = forms.DateTimeField(input_formats=['%d/%m/%Y %H:%M'])
auctionstart = forms.DateTimeField(input_formats=['%d/%m/%Y %H:%M'])
auctionend = forms.DateTimeField(input_formats=['%d/%m/%Y %H:%M'])
class Meta:
model = Auction
......@@ -86,7 +87,6 @@ class StartAuctionForm(forms.ModelForm):
end_time = self.cleaned_data.get('auctionend')
start_time = self.cleaned_data.get('auctionstart')
current_date = timezone.now()
auctioned_item = self.cleaned_data['itemid']
auctions = Auction.objects.all()
......@@ -114,11 +114,15 @@ class CreateStoreForm(forms.ModelForm):
class editBoodleUserForm(forms.ModelForm):
class Meta:
model = BoodleUser
fields = ['displayname', 'username', 'userid']
widgets = {'userid': forms.HiddenInput()}
model = AuthUser
fields = ['username', 'id']
widgets = {'id': forms.HiddenInput()}
labels = {
'username': _('User Name'),
'displayname': _('Display Name')
}
\ No newline at end of file
'username': _('User Name')
}
class CreateUserForm(UserCreationForm):
class Meta:
model=User
fields=['username', 'email', 'password1', 'password2']
\ No newline at end of file
# Generated by Django 3.2.12 on 2022-05-18 09:48
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0004_delete_userfavorites'),
]
operations = [
migrations.DeleteModel(
name='Boodleuser',
),
]
......@@ -26,7 +26,7 @@ class AuctionBid(models.Model):
amount = models.DecimalField(max_digits=15, decimal_places=4)
bidtime = models.DateTimeField(blank=True, null=True)
auctionid = models.ForeignKey(Auction, models.DO_NOTHING, db_column='auctionid')
boodleuserid = models.ForeignKey('BoodleUser', models.DO_NOTHING, db_column='boodleuserid')
userid = models.ForeignKey('AuthUser', models.DO_NOTHING, db_column='userid')
class Meta:
managed = False
......@@ -99,20 +99,6 @@ class AuthUserUserPermissions(models.Model):
unique_together = (('user', 'permission'),)
class BoodleUser(models.Model):
userid = models.AutoField(primary_key=True)
displayname = models.CharField(max_length=255)
pword = models.CharField(max_length=255)
username = models.CharField(max_length=255)
class Meta:
managed = False
db_table = 'boodleuser'
def __str__(self):
return '%s' % (self.userid)
class DjangoAdminLog(models.Model):
action_time = models.DateTimeField()
object_id = models.TextField(blank=True, null=True)
......@@ -168,7 +154,7 @@ class Item(models.Model):
class Meta:
managed = False
db_table = 'item'
def __str__(self):
return '%s' % (self.itemname)
......@@ -178,11 +164,8 @@ class Store(models.Model):
storeid = models.AutoField(primary_key=True)
storename = models.CharField(max_length=255)
storedesc = models.CharField(max_length=700)
userid = models.ForeignKey(BoodleUser, models.DO_NOTHING, db_column='userid', blank=True, null=True)
userid = models.ForeignKey(AuthUser, models.DO_NOTHING, db_column='userid', blank=True, null=True)
class Meta:
managed = False
db_table = 'store'
def __str__(self):
return '%s' % (self.storeid)
\ No newline at end of file
......@@ -8,7 +8,6 @@ urlpatterns = [
path('auction', auction, name='auction'),
path('auction/<int:pk>/',auction, name='auctionid'),
path('error404', error404, name='error404'),
path('store', tempstore, name='store'), # this is tempstore
path('store/<int:pk>', mystore, name='storeid'),
path('additem', addItem, name='additem'),
path('additem/<int:pk>', addItem, name='additemid'),
......@@ -16,9 +15,12 @@ urlpatterns = [
path('jsi18n', JavaScriptCatalog.as_view(), name='js-catlog'),
path('startauction', startAuction, name='startauction'),
path('startauction/<int:pk>', startAuction, name='startauctionid'),
# this is tempuser profile
path('profile', tempProfile, name='profile'),
path('profile/<int:pk>', profile, name='profileid'),
path('editstore/<int:pk>', editStore, name='editstoreid'),
path('editProfile/<int:pk>', editProfile, name='editProfile'),
path('login', loginPage, name='login'),
path('register', registerPage, name='register'),
path('logout', logoutUser, name='logout'),
path('help', help, name='help'),
path('about', about, name='about')
]
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment