Skip to content

Conversation

@vpt-odoo
Copy link
Collaborator

@vpt-odoo vpt-odoo commented Feb 2, 2021

No description provided.

import json
import os
from urllib.parse import urlparse
import redis
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import modules should be in alphabetic order.
and import multiple modules in one line from the parent module.
like, from werkzeug.routing import Map, Rule

error = None
with open('/home/vivek/Desktop/Shopping Site/item_list.json') as f:
data=json.load(f)
return self.render_template("homepage.html", error=error, items=data)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use a relative path instead of an absolute path.
also, it will raise an error when you don't have data.
try to declare an empty list of data.

filter = input.value.toUpperCase();
ul = document.getElementById("myProducts");
li = ul.getElementsByTagName("li");
for (i = 0; i < li.length; i++) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use native method instead of for loop.

@@ -0,0 +1,63 @@
var cart = [];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ES6 standards to declare the variables.

</head>
<div>
{% block body %}{% endblock %}
</div> No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a blank newline at the end of each file.

app = ShoppingSite({
'redis_host': redis_host,
'redis_port': redis_port
})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app = ShoppingSite({
        'redis_host': redis_host,
        'redis_port': redis_port
    })

return app

if __name__ == "__main__":
from werkzeug.serving import run_simple
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import should be placed at the top

@@ -0,0 +1,63 @@
var cart = [];
$(function () {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use document.ready here

@nla-odoo
Copy link
Collaborator

nla-odoo commented Feb 2, 2021

don't leave extra spaces and do proper indentations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants