Skip to content

Commit

Permalink
Small tweaks as discussed with bmispelon
Browse files Browse the repository at this point in the history
  • Loading branch information
MarysiaLowas committed Aug 7, 2014
1 parent e7ddcc0 commit 31a73a6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion django_orm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ We have different pieces in place: the `Post` model is defined in `models.py`, w

This is exactly what *views* are supposed to do: connect models and templates. In our `post_list` *view* we will need to take models we want to display and pass them to the template. So basically in a *view* we decide what (model) will be displayed in a template.

OK, so how we will achieve it?
OK, so how will we achieve it?

We need to open our `blog/views.py`. So far `post_list` *view* looks like this:

Expand Down
2 changes: 1 addition & 1 deletion django_templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ As you can see, all we've got is this:

[<Post: My second post>, <Post: My first post>]

This means that Django understand it as a list of objects. Remember from __Introduction to Python__ how we can display lists? Yes, with the for loops! In a Django template, you do them this way:
This means that Django understands it as a list of objects. Remember from __Introduction to Python__ how we can display lists? Yes, with the for loops! In a Django template, you do them this way:

{% for post in posts %}
{{ post }}
Expand Down
8 changes: 4 additions & 4 deletions python_introduction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Now, try writing the following command:

Don't be surprised with the weird names. Go to the link: http://hubpages.com/hub/50-Doll-Names to look for more cute doll names. :P Just Kidding (You should do this if and only if you have a lot of time).

Above, you just created a variable named *django_dolls* with three key-value pairs. The key Dottie points to the value 15, Lottie points to the value 305, EmmyLou points to the value 17. Do you want to check? Type:
Above, you just created a variable named `django_dolls` with three key-value pairs. The key Dottie points to the value 15, Lottie points to the value 305, EmmyLou points to the value 17. Do you want to check? Type:

>>> print(django_dolls['Dottie'])
15
Expand All @@ -240,7 +240,7 @@ Like the lists, using `len()` method on the dictionaries, returns the number of

I hope it makes sense uptil now. :) Ready for some more fun with Dictionaries? Hop on the next line for some amazing things.

You can use `del()` command to delete an item in the dictionary which has particular. Say, if you want to delete the entry corresponding to the key 'Dottie', just type in the following command:
You can use `del` command to delete an item in the dictionary which has particular. Say, if you want to delete the entry corresponding to the key 'Dottie', just type in the following command:

>>> del django_dolls['Dottie']
>>> django_dolls
Expand Down Expand Up @@ -315,7 +315,7 @@ You can give Python as many numbers to compare as you want, and it will give you

Accidently, you just learned about a new type of object in Python. It's called a __Boolean__ -- and it probably is the easiest type there is.

There are only two boolean objects:
There are only two Boolean objects:
- True
- False

Expand Down Expand Up @@ -351,7 +351,7 @@ Try this:
>>> if 3 > 2:
...

So far nothing has happened, as evidenced by the dots `...` instead of incentives `>>>` which we saw so far. Python expects us to give further instructions to it which are supposed to be executed if the condition `3 > 2` turns out to be true (or True for that matter). Let’s try to make Python print “It works!”:
So far nothing has happened, as evidenced by the dots `...` instead of incentives `>>>` which we saw so far. Python expects us to give further instructions to it which are supposed to be executed if the condition `3 > 2` turns out to be true (or `True` for that matter). Let’s try to make Python print “It works!”:

>>> if 3 > 2:
... print('It works!')
Expand Down

0 comments on commit 31a73a6

Please sign in to comment.