i have 2 tables to complete this function, in my Booking1 table i have car_id, user_id, start_datetime and end_datetime, pickup _location, return_locaiton . and in my CarModel table, i have car_model_code. outlet_id as foreign key, car_model_name, booking_price. inventory_deduc t and car_inventory, etc.
i have separate this two tables. only deduct inventory 24 hours before customer's start_datetime of booking car. as before this, i...
User Profile
Collapse
-
How to include CSS in Django Framewok?
hi
i am designing my website currently by using CSS. i have a basetemplate and the rest of template will inherent from this basetemplate. however, i feel it does not have CSS effect, although my CSS is in place and i can see the effect in dreamweaver, however the inherented webpages can not see any effect.i am not sure where is wrong, it seems they never read css file. my basedtemplate is in the following:
[code=python]... -
sometimes, i find out that inventory will turn out to be negative....is this really correct to do in this way?? hmm...if inventory becomes negative means the company is lack of this amount of car? i am not sure if this kind of scenario is correct. as from my current coding, it will occurs this negative inventory scenario.i would like to hear from your opinion....Leave a comment:
-
i have tried it, in fact car inventory is in CarModel table which is separated from Booking1 table, as i have normalized the database table. Thus i edited the code in the following and i think it works.
[code=python]
def inventory(reque st):
allObj=[]
for i in Booking1.object s.all():
invtime=i.start _datetime
#print invtime
#print type(invtime)
now=datetime.da tetime.now()...Leave a comment:
-
i think i need to create one more datebase table and its type should boolean.so when it deducts, i should turn it to true. and when it does not deducts, the default setting should be false. if my understanding is not wrong, i believe this should be the correct way. i will try to do now, thanks so much for giving me this bright idea. i will try now and let you know later. :)...Leave a comment:
-
Can Help me with this Search Function? Help!
hi
currently i am doing this search function for car booking website. it can search through either car seats or CarModel. it seems it able to do search function, however i small problem occurs to me. As i would also like to show the customer whether the car is available or not available. Basically it is car status at the moment. However, i am not sure how to do this. my ideas is that if car_inventory>0 , show available, otherwise... -
i have checked its datatype, it is datetime.dateti me. so i use str() to change its data type back to string and thus can compare: my change code is in the following and it works. however, i think there is an logic error, as everytime i click update inventory link, it will deduct inventory one more time. this function is mainly for admin or staff user. if one staff click this link to see the inventory in warehouse, it deduct one already, then within...Leave a comment:
-
how to do if statement in Template??
hi i am doing search function currently and its function should be correct, however, in my search.html i would like to go through a for loop and if inventory is bigger than zero, it will display available, otherwise, it will display " not available". however, i think my syntax for if statement got error, can anyone help me with this.
my search function is:
[code=python]
def search(request) :
myData... -
hi, thanks for it, i have done according to this logic and i feel it is correct. but it got small error. my code is in the following:
[code=python]
def inventory(reque st):
allObj=[]
for i in Booking1.object s.all():
#print i.booking_time
invtime=i.start _datetime
now=datetime.da tetime.now()
one_day=60*60*2 4
diff=comp_dates (invtime,str(no w).split('.')[0])...Leave a comment:
-
hi, thanks for it, i have done according to this logic and i feel it is correct. but it got small error. my code is in the following:
[code=python]
def inventory(reque st):
allObj=[]
for i in Booking1.object s.all():
#print i.booking_time
invtime=i.start _datetime
now=datetime.da tetime.now()
one_day=60*60*2 4
diff=comp_dates (invtime,str(no w).split('.')[0])...Leave a comment:
-
hi, thanks for it, i have done according to this logic and i feel it is correct. but it got small error. my code is in the following:
[code=python]
def inventory(reque st):
allObj=[]
for i in Booking1.object s.all():
#print i.booking_time
invtime=i.start _datetime
now=datetime.da tetime.now()
one_day=60*60*2 4
diff=comp_dates (invtime,str(no w).split('.')[0])...Leave a comment:
-
sorry, when i restart the server, it pop me the error message, i am not sure where is wrong, just now still able to work.
my error message is
Request Method: GET
Request URL: http://localhost:8000/proceed/
Exception Type: ValueError
Exception Value: The view fyp2.car.views. confirmUp didn't return an HttpResponse object.
[code=python]
def confirmUp(reque st):
Array=[]...Leave a comment:
-
sorry, when i restart the server, it pop me the error message, i am not sure where is wrong, just now still able to work.
my error message is
Exception Value: The view fyp2.car.views. confirmUp didn't return an HttpResponse object.
[code=python]
def confirmUp(reque st):
Array=[]
ba={}
q=request.sessi on['BK_id']
uID=request.use r.id
#ba=Booking1.ob jects.get(id=q)...Leave a comment:
-
can help me with this Update inventory funciton, where is wrong?
hi
currently i am doing this car booking website. i would like to only update our inventory one day before customer's start booking time, thus before that, i am still able to rent to other customers. E.g. if she book two month before, i can still rent this car to others within this 2 month, but one day before i need to deduct this car inventory as the next day i have to give this car to that customer.
the following is my car... -
You are really expert, it really works by adding in str (), but where can i know what is their data type before using str() to make them belong to the same data type. in fact, if i know this, i can better prevent it from happening again in the future programming. haha, thanks so much :) i am so happy it works now! yeah!!...Leave a comment:
-
i do have tried before, but it is the same result, can help me with this.. is indentation or...i am really not sure where went wrong. thanks for any help:)...Leave a comment:
-
what is the Error in my nested if statement in for loop?
hi
currently i am doing car rental website and one of my update booking function encounter some problem which i also do not know where is wrong. basically i would to check through my Booking1 table if the id user posted over equal to any id in my Booking1 table. if exist, then we will let it proceed otherwise it will go to Notexist page
to state to customer that this booking id do not exist. my code is in the following yet i don not... -
thanks for your kind help, in that scenario it works according to your way, but one thing i do not understand is that why everytime it will go to updateinventory page even the content has changed to inventory page.it seems quite strange to me. i mean how the updateinventory page knows inventory pages' content??Althou gh it works in the way i want yet i do not understand its logic..hmm, if possible, can explain this to me, thanks so much.:)
...Leave a comment:
-
how to correctly nest if statement into for loop?
hi, currently i am doing a car rental website, once it is bigger tthan 1 day's time which is 24 hours, its inventory will be updated and only admin can executed this. However if it is smaller than 24 hours, then it will still remain at the current inventory. the car's booking time is inside my Booking1 table and car_inventory is inside CarModel table.
[code=python]
def inventory(reque st):
allObj=[]
for i in... -
how to Check if the id is exist in my database?
hi
currently i am doing car booking website. once customer booked car with us, we will give customer the booking id, thus if they would like to update or cancel, they need to type in their respective booking id. currently i am looping through all the id in my Booking1 table and check if there is any id match with the id post over from user. my code of update is in the following:
[code=python]
def confirmUp(reque st):...
No activity results to display
Show More
Leave a comment: