Anonymous user
Django for Designers/Adding models: Difference between revisions
m
fixed a minor typo.
imported>Aldeka No edit summary |
imported>Strixcuriosus m (fixed a minor typo.) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 67:
<div class="instructor">The tag slug is stored in another CharField, which we've seen before. But what's this ManyToManyField? Well, it's one type of field for denoting a relationship between two models.
In relational databases, there
With a ManyToManyField, on the other hand, the relationship isn't exclusive for either of the models involved. For instance, you could imagine having a Pizza model and a Topping model. Each Pizza can have multiple Toppings, and each Topping can be on multiple Pizzas.
Line 291:
More information on making queries with Django's ORM can be found in the Django docs at https://docs.djangoproject.com/en/dev/topics/db/queries/#retrieving-objects.
<div class="instructor">Go take a break!!!</div>
== Part 3.5: Changing our mind and adding users ==
<div class="instructor">Time: 1 hour 35 minutes</div>
<div class="instructor">D'oh! You know what every social bookmarking app has, that ours doesn't have? Users!
Line 763 ⟶ 767:
Save and commit your error-catching work.
<!-- ==== Let me show off ====
So far, we've all only been able to access our own Django-powered sites. In this section, you will see how to access my (the instructor's) super cool bookmarks site! (We'll talk later about how you can share your code the same way. It might require firewall configuration changes on your computer, so we save that complexity for later.)
Line 774 ⟶ 778:
When you visit the instructor's app, you are interacting with the database stored on her laptop. So all the changes made by other people in the room are reflected in what you see! So try not to be too silly.
No demo for now.
-->
<!-- Instructor git note: git push origin HEAD:pre-part-4 00-->
[[Django_for_Designers/CRUD|Next page]]
|