Discussion:
Anyone interested in reviewing the code of a small project - BookMarker
Aseem Bansal
2014-05-25 11:20:38 UTC
Permalink
So I am making a hobby project which can be seen
here https://github.com/anshbansal/Bookmarker . This is my first time
working with Django/jQuery and first personal web app project. Is there
anyone interested in reviewing the code? I am willing to give any
explanations if necessary.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/011746d8-d628-4749-a0e9-5b7fcc477555%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Avraham Serour
2014-05-25 12:58:48 UTC
Permalink
any explanation you think would be necessary should be documented, either
in code comments and/or on the project wiki/readme
this is actually a very important part of the project, boring? yes, but
this it the first (and maybe only) thing people will look
So I am making a hobby project which can be seen here
https://github.com/anshbansal/Bookmarker . This is my first time working
with Django/jQuery and first personal web app project. Is there anyone
interested in reviewing the code? I am willing to give any explanations if
necessary.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/011746d8-d628-4749-a0e9-5b7fcc477555%40googlegroups.com<https://groups.google.com/d/msgid/django-users/011746d8-d628-4749-a0e9-5b7fcc477555%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFWa6tJtfj9_X4qh%3DWJiw-tebTsH%3DSVcmM0BiHz1oytTyDaCDA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Mark Phillips
2014-05-25 15:47:45 UTC
Permalink
I took a quick look at your code and my first comment is to add comments to
your code. I would like to read in your comments what you are trying to
accomplish, and then I can look at the code with a more informed eye.

Mark
Post by Avraham Serour
any explanation you think would be necessary should be documented, either
in code comments and/or on the project wiki/readme
this is actually a very important part of the project, boring? yes, but
this it the first (and maybe only) thing people will look
So I am making a hobby project which can be seen here
https://github.com/anshbansal/Bookmarker . This is my first time working
with Django/jQuery and first personal web app project. Is there anyone
interested in reviewing the code? I am willing to give any explanations if
necessary.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/011746d8-d628-4749-a0e9-5b7fcc477555%40googlegroups.com<https://groups.google.com/d/msgid/django-users/011746d8-d628-4749-a0e9-5b7fcc477555%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAFWa6tJtfj9_X4qh%3DWJiw-tebTsH%3DSVcmM0BiHz1oytTyDaCDA%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAFWa6tJtfj9_X4qh%3DWJiw-tebTsH%3DSVcmM0BiHz1oytTyDaCDA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEqej2PafCX-F6_i9iC1wJEwv18X_KUTxRrv-YQaQbcXCzMRdg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
shmengie
2014-05-26 13:58:02 UTC
Permalink
Looks like you're getting a handle on django.
You're not using Class Based Views, but you import generic. Since you're
getting familiar with django, you *might* want to hold off on delving into
CBVs. They're very powerful and can reduce coding, but can be difficult to
wrap your head around.

Once you've created your app with functions, then perhaps go back and wrap
'em in CBV's. CBV's have a lot of power, but while learning the basics,
sticking with functions can be a lot less assimilate all at once.

In your template, you have CSS at the bottom. CSS is typically linked in
the <head></head> section. I suppose most web browsers today are okay
either way. Javascript/jquery is typically near the end of the html, as
you have it.

I wish w3c/html5 spec'd tags for <css></css> and <script></script>
locations. Javascript more than css links seem feel sloppy to me, ahh
well, it is what it is.

Next, I suspect you might want to work on a base.html and working with
{{include's}}. It's a fairly easy concept to grasp and some of the beauty
of django's templating. I wouldn't recommend delving into custom template
tags yet, but it's good to know they exist.

You're template is not complex, being familiar with partials is an easy way
to keep it *simpler.*

-Joe
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d5999370-00bb-4bd8-8982-59dab7eb3630%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Aseem Bansal
2014-05-26 15:32:14 UTC
Permalink
Thanks Shmengie. I was thinking of using class based views as it was
pointed in tutorial that they are better but I was not sure which ones are
good here. So I decided to prioritize making it work and then go for
refactoring. CSS location I will change.

The tutorials used include's but I didn't get the benefit of using that in
a small project. I mean in a program I can think of independent units and
turn them into functions but in HTML how do you go about breaking it into
parts? I mean the thought process for deciding the parts. If I have many
files then I can extract the common things but for a single file I am not
sure how to go about that.

Partials refers to the sub-templates. Correct?

Custom template tags - I'll put that on my TODO list for later reading.
Post by shmengie
Looks like you're getting a handle on django.
You're not using Class Based Views, but you import generic. Since you're
getting familiar with django, you *might* want to hold off on delving into
CBVs. They're very powerful and can reduce coding, but can be difficult to
wrap your head around.
Once you've created your app with functions, then perhaps go back and wrap
'em in CBV's. CBV's have a lot of power, but while learning the basics,
sticking with functions can be a lot less assimilate all at once.
In your template, you have CSS at the bottom. CSS is typically linked in
the <head></head> section. I suppose most web browsers today are okay
either way. Javascript/jquery is typically near the end of the html, as
you have it.
I wish w3c/html5 spec'd tags for <css></css> and <script></script>
locations. Javascript more than css links seem feel sloppy to me, ahh
well, it is what it is.
Next, I suspect you might want to work on a base.html and working with
{{include's}}. It's a fairly easy concept to grasp and some of the beauty
of django's templating. I wouldn't recommend delving into custom template
tags yet, but it's good to know they exist.
You're template is not complex, being familiar with partials is an easy
way to keep it *simpler.*
-Joe
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/33c0987a-9edb-42dc-b37a-28c6273d2253%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Andre Terra
2014-05-26 16:18:38 UTC
Permalink
Why are you using the webbrowser library? I don't see how it makes sense..


Cheers,
AT
Post by Aseem Bansal
Thanks Shmengie. I was thinking of using class based views as it was
pointed in tutorial that they are better but I was not sure which ones are
good here. So I decided to prioritize making it work and then go for
refactoring. CSS location I will change.
The tutorials used include's but I didn't get the benefit of using that in
a small project. I mean in a program I can think of independent units and
turn them into functions but in HTML how do you go about breaking it into
parts? I mean the thought process for deciding the parts. If I have many
files then I can extract the common things but for a single file I am not
sure how to go about that.
Partials refers to the sub-templates. Correct?
Custom template tags - I'll put that on my TODO list for later reading.
Post by shmengie
Looks like you're getting a handle on django.
You're not using Class Based Views, but you import generic. Since you're
getting familiar with django, you *might* want to hold off on delving into
CBVs. They're very powerful and can reduce coding, but can be difficult to
wrap your head around.
Once you've created your app with functions, then perhaps go back and
wrap 'em in CBV's. CBV's have a lot of power, but while learning the
basics, sticking with functions can be a lot less assimilate all at once.
In your template, you have CSS at the bottom. CSS is typically linked in
the <head></head> section. I suppose most web browsers today are okay
either way. Javascript/jquery is typically near the end of the html, as
you have it.
I wish w3c/html5 spec'd tags for <css></css> and <script></script>
locations. Javascript more than css links seem feel sloppy to me, ahh
well, it is what it is.
Next, I suspect you might want to work on a base.html and working with
{{include's}}. It's a fairly easy concept to grasp and some of the beauty
of django's templating. I wouldn't recommend delving into custom template
tags yet, but it's good to know they exist.
You're template is not complex, being familiar with partials is an easy
way to keep it *simpler.*
-Joe
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/33c0987a-9edb-42dc-b37a-28c6273d2253%40googlegroups.com<https://groups.google.com/d/msgid/django-users/33c0987a-9edb-42dc-b37a-28c6273d2253%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKBiv3zcZRBjCQGy%3D_9FO0pu%2BKDOb_0n%2BRrkGB44byEYx8u_ZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Aseem Bansal
2014-05-26 17:03:10 UTC
Permalink
I am using webbrowser library because this project is supposed to store
bookmarks instead of my browser. Storing bookmarks in a app is useful only
if there is a way to open them via the app. I was initially serving the
bookmarks as hyperlinks but then came across a problem. Web browser's were
not allowing me to open locally stored web pages. So I decided to open the
webpages through webbrowser library as client viewing the page and server
are on same machine.

Relevant discussion on this
forum https://groups.google.com/forum/#!topic/django-users/rSqSftkl5mg

Ask in case any confusions.
Post by Andre Terra
Why are you using the webbrowser library? I don't see how it makes sense..
Cheers,
AT
Post by Aseem Bansal
Thanks Shmengie. I was thinking of using class based views as it was
pointed in tutorial that they are better but I was not sure which ones are
good here. So I decided to prioritize making it work and then go for
refactoring. CSS location I will change.
The tutorials used include's but I didn't get the benefit of using that
in a small project. I mean in a program I can think of independent units
and turn them into functions but in HTML how do you go about breaking it
into parts? I mean the thought process for deciding the parts. If I have
many files then I can extract the common things but for a single file I am
not sure how to go about that.
Partials refers to the sub-templates. Correct?
Custom template tags - I'll put that on my TODO list for later reading.
Post by shmengie
Looks like you're getting a handle on django.
You're not using Class Based Views, but you import generic. Since
you're getting familiar with django, you *might* want to hold off on
delving into CBVs. They're very powerful and can reduce coding, but can be
difficult to wrap your head around.
Once you've created your app with functions, then perhaps go back and
wrap 'em in CBV's. CBV's have a lot of power, but while learning the
basics, sticking with functions can be a lot less assimilate all at once.
In your template, you have CSS at the bottom. CSS is typically linked in
the <head></head> section. I suppose most web browsers today are okay
either way. Javascript/jquery is typically near the end of the html, as
you have it.
I wish w3c/html5 spec'd tags for <css></css> and <script></script>
locations. Javascript more than css links seem feel sloppy to me, ahh
well, it is what it is.
Next, I suspect you might want to work on a base.html and working with
{{include's}}. It's a fairly easy concept to grasp and some of the beauty
of django's templating. I wouldn't recommend delving into custom template
tags yet, but it's good to know they exist.
You're template is not complex, being familiar with partials is an easy
way to keep it *simpler.*
-Joe
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/33c0987a-9edb-42dc-b37a-28c6273d2253%40googlegroups.com<https://groups.google.com/d/msgid/django-users/33c0987a-9edb-42dc-b37a-28c6273d2253%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/44ba1e07-457c-40b7-b205-c179bf9de010%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
shmengie
2014-05-27 13:39:46 UTC
Permalink
Partials/sub-templates are the same.

For a small one pager, includes aren't very useful. As for the logic in
using them, that's more difficult to elaborate since it depends a lot on
the layout and design of the site.

There are a couple of different types of "sub sections" you can implement.
html fragments, which are useful in larger sites. Then there are fragments
of css/js which even tho it's all html, I refer to html as presentation
code and css/js as links/includes. For a larger site this is more useful,
but since you're using this as a learning tool, why not implement concepts
that are useful in larger sites.

I referenced the custom tags, because you can dynamically include CSS &
Javascript (partials) based on rules with them. Which is a nifty concept,
though I've seen it used, Ive not implemented them myself.... I don't
wish to push too much on your plate, w/out knowing your background, but
this might be a good concept for you to tackle at this point.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e0080f48-2cc5-4ca3-b263-5597a3eecc95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Aseem Bansal
2014-05-27 14:56:19 UTC
Permalink
Background? I have some experience(a few months only) with Java 6/Struts
1.2 for web development. Started working on Python May 2013. Not
continuously but as a hobby for scripting purposes and some automation. I
guess my github and stackoverflow account can give you a better idea
https://github.com/anshbansal/general
http://stackoverflow.com/users/2235567/aseem-bansal
Post by shmengie
Partials/sub-templates are the same.
For a small one pager, includes aren't very useful. As for the logic in
using them, that's more difficult to elaborate since it depends a lot on
the layout and design of the site.
There are a couple of different types of "sub sections" you can
implement. html fragments, which are useful in larger sites. Then there
are fragments of css/js which even tho it's all html, I refer to html as
presentation code and css/js as links/includes. For a larger site this is
more useful, but since you're using this as a learning tool, why not
implement concepts that are useful in larger sites.
I referenced the custom tags, because you can dynamically include CSS &
Javascript (partials) based on rules with them. Which is a nifty concept,
though I've seen it used, Ive not implemented them myself.... I don't
wish to push too much on your plate, w/out knowing your background, but
this might be a good concept for you to tackle at this point.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/52ef59f5-8e13-4c4f-9988-6d9264bcca6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Aseem Bansal
2014-05-28 20:26:56 UTC
Permalink
Anyone interested in reviewing updated code? Now the search functionality
is working. I have added comments and a link with screenshots of working
functionality. Also refactoring done in the Javascript to make code easier
to read. I think the functionality should be clearer by the changed code
now. I have added a partial for rendering as was suggested.

There are some parts of code which can be improved but I don't know exactly
how to implement the changes.
Like the Javascript needs the static URL for addition of categories on
screen. It can be done in a much better way if I can use a partial here.
But I am not sure how to render a partial by the html() function of a
javascript. Any ideas?
Post by Aseem Bansal
Background? I have some experience(a few months only) with Java 6/Struts
1.2 for web development. Started working on Python May 2013. Not
continuously but as a hobby for scripting purposes and some automation. I
guess my github and stackoverflow account can give you a better idea
https://github.com/anshbansal/general
http://stackoverflow.com/users/2235567/aseem-bansal
Post by shmengie
Partials/sub-templates are the same.
For a small one pager, includes aren't very useful. As for the logic in
using them, that's more difficult to elaborate since it depends a lot on
the layout and design of the site.
There are a couple of different types of "sub sections" you can
implement. html fragments, which are useful in larger sites. Then there
are fragments of css/js which even tho it's all html, I refer to html as
presentation code and css/js as links/includes. For a larger site this is
more useful, but since you're using this as a learning tool, why not
implement concepts that are useful in larger sites.
I referenced the custom tags, because you can dynamically include CSS &
Javascript (partials) based on rules with them. Which is a nifty concept,
though I've seen it used, Ive not implemented them myself.... I don't
wish to push too much on your plate, w/out knowing your background, but
this might be a good concept for you to tackle at this point.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b766787d-1d44-4c70-98e2-037c7258ede8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...