You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cs/django_orm/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ Tohle je jednoduché: importujeme model `Post` z `blog.models`. Pojďme znovu zk
46
46
47
47
```
48
48
>>> Post.objects.all()
49
-
[<Post: titulek mého prvního příspěvku>, <Post: titulky dalších příspěvků>]
49
+
<QuerySet [<Post: titulek mého prvního příspěvku>, <Post: titulky dalších příspěvků>]>
50
50
```
51
51
52
52
To je seznam příspěvků, které jsme dříve vytvořily pomocí Django administrátorského rozhraní. Teď nicméně chceme vytvořit příspěvky použitím Pythonu, tak jak na to?
@@ -71,7 +71,7 @@ Jaké uživatele máme v naší databázi? Zkus tohle:
71
71
72
72
```
73
73
>>> User.objects.all()
74
-
[<User: ola>]
74
+
<QuerySet [<User: ola>]>
75
75
```
76
76
77
77
Tohle je superuser, kterého jsme vytvořily dříve! Pojďme si teď vzít instanci tohoto uživatele:
@@ -92,7 +92,7 @@ Hurá! Chceš se podívat, jestli to fungovalo?
92
92
93
93
```
94
94
>>> Post.objects.all()
95
-
[<Post: my post title>, <Post: another post title>, <Post: Sample title>]
95
+
<QuerySet [<Post: my post title>, <Post: another post title>, <Post: Sample title>]>
Copy file name to clipboardExpand all lines: en/django_orm/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ This is simple: we import the model `Post` from `blog.models`. Let's try display
54
54
{% filename %}command-line{% endfilename %}
55
55
```python
56
56
>>> Post.objects.all()
57
-
[<Post: my post title>, <Post: another post title>]
57
+
<QuerySet [<Post: my post title>, <Post: another post title>]>
58
58
```
59
59
60
60
This is a list of the posts we created earlier! We created these posts using the Django admin interface. But now we want to create new posts using Python, so how do we do that?
@@ -83,7 +83,7 @@ What users do we have in our database? Try this:
83
83
{% filename %}command-line{% endfilename %}
84
84
```python
85
85
>>> User.objects.all()
86
-
[<User: ola>]
86
+
<QuerySet [<User: ola>]>
87
87
```
88
88
89
89
This is the superuser we created earlier! Let's get an instance of the user now:
@@ -107,7 +107,7 @@ Hurray! Wanna check if it worked?
107
107
{% filename %}command-line{% endfilename %}
108
108
```python
109
109
>>> Post.objects.all()
110
-
[<Post: my post title>, <Post: another post title>, <Post: Sample title>]
110
+
<QuerySet [<Post: my post title>, <Post: another post title>, <Post: Sample title>]>
Copy file name to clipboardExpand all lines: es/django_orm/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ Vamos a mostrar todos nuestros posts primero. Puedes hacerlo con el siguiente co
41
41
Esto es simple: importamos el modelo `Post` de `blog.models`. Vamos a intentar mostrar todos los posts nuevamente:
42
42
43
43
>>> Post.objects.all()
44
-
[<Post: my post title>, <Post: another post title>]
44
+
<QuerySet [<Post: my post title>, <Post: another post title>]>
45
45
46
46
47
47
Esta es una lista de las posts creadas anteriormente. Hemos creado estos posts usando la interfaz del administrador de Django. Sin embargo, ahora queremos crear nuevos posts usando Python, ¿cómo lo hacemos?
@@ -63,7 +63,7 @@ Primero importemos el modelo User:
63
63
¿Qué usuarios tenemos en nuestra base de datos? Veamos:
64
64
65
65
>>> User.objects.all()
66
-
[<User: ola>]
66
+
<QuerySet [<User: ola>]>
67
67
68
68
69
69
Este es el super usuario que creamos anteriormente, Vamos a obtener una instancia de ese usuario ahora:
Copy file name to clipboardExpand all lines: fr/django_orm/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ Rien de compliqué : nous importons le modèle `Post` depuis notre `blog.models`
44
44
45
45
```python
46
46
>>> Post.objects.all()
47
-
[<Post: my post title>, <Post: another post title>]
47
+
<QuerySet [<Post: my post title>, <Post: another post title>]>
48
48
```
49
49
50
50
Cela nous permet d'obtenir une liste des posts que nous avons créé tout à l'heure ! Rappelez-vous : nous avions créé ces posts à l'aide de l'interface d'administration de Django. Cependant, nous aimerions maintenant créer de nouveaux posts à l'aide de Python : comment allons-nous nous y prendre ?
@@ -69,7 +69,7 @@ Avons-nous des utilisateurs dans notre base de données ? Voyons voir :
69
69
70
70
```python
71
71
>>> User.objects.all()
72
-
[<User: ola>]
72
+
<QuerySet [<User: ola>]>
73
73
```
74
74
75
75
C'est le superutilisateur que nous avions créé tout à l'heure ! Essayons maintenant d'obtenir une instance de l'utilisateur :
@@ -90,7 +90,7 @@ Youpi ! Et si on vérifiait quand même si ça a marché ?
90
90
91
91
```python
92
92
>>> Post.objects.all()
93
-
[<Post: my post title>, <Post: another post title>, <Post: Sample title>]
93
+
<QuerySet [<Post: my post title>, <Post: another post title>, <Post: Sample title>]>
Copy file name to clipboardExpand all lines: hu/django_orm/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ Hoppá, egy hiba! Azt mondja, hogy nincs olyan, hogy Post. Igaza van -- elfelejt
41
41
Ez egyszerű: importáljuk a `Post` modellt a `blog.models`-ből. Próbáljuk meg újra megjeleníteni a Post-okat:
42
42
43
43
>>> Post.objects.all()
44
-
[<Post: my post title>, <Post: another post title>]
44
+
<QuerySet [<Post: my post title>, <Post: another post title>]>
45
45
46
46
47
47
Egy lista a posztokból, amiket korábban megírtál! Ezeket még a Django admin felületén hoztad létre. Viszont ugyanezt meg tudod tenni a Python segítségével is. De vajon hogyan?
@@ -63,7 +63,7 @@ Először importáljuk az User modellt:
63
63
Milyen felhasználók vannak az adatbázisban? Próbáld meg ezt:
64
64
65
65
>>> User.objects.all()
66
-
[<User: ola>]
66
+
<QuerySet [<User: ola>]>
67
67
68
68
69
69
Ez a superuser, amit korábban hoztál létre! Most vegyük ennek a felhasználónak egy instance-ét:
@@ -81,7 +81,7 @@ Most pedig végre létrehozhatjuk a posztot:
81
81
Hurrá! Meg akarod nézni, hogy működött-e?
82
82
83
83
>>> Post.objects.all()
84
-
[<Post: my post title>, <Post: another post title>, <Post: Sample title>]
84
+
<QuerySet [<Post: my post title>, <Post: another post title>, <Post: Sample title>]>
85
85
86
86
87
87
Ott is van, egy újabb poszt a listában!
@@ -155,4 +155,4 @@ Ez egy nagyon hatékony módszer, és a segítségével bonyolult query-ket írh
155
155
Remek! Most már készen állsz a következő részre! Hogy kilépj a shellből, gépeld be ezt:
Copy file name to clipboardExpand all lines: it/django_orm/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ Ops! È comparso un errore. Ci dice che non c'è nessun Post. È corretto -- ci
41
41
È semplice: importiamo il modello `Post` da `blog.models`. Proviamo a rendere di nuovo visibili tutti i post:
42
42
43
43
>>> Post.objects.all()
44
-
[<Post: my post title>, <Post: another post title>]
44
+
<QuerySet [<Post: my post title>, <Post: another post title>]>
45
45
46
46
47
47
È una lista di post che abbiamo creato prima! Abbiamo creato questi post usando l'interfaccia di ammisnistrazione di Django. Comunque sia, ora vogliamo creare nuovi post usando Python, quindi come lo facciamo?
@@ -63,7 +63,7 @@ Importiamo il modello User prima:
63
63
Quali utenti abbiamo nel nostro database? Prova questo:
64
64
65
65
>>> User.objects.all()
66
-
[<User: ola>]
66
+
<QuerySet [<User: ola>]>
67
67
68
68
69
69
È il superuser che abbiamo creato prima! Ora prendiamo un'istanza del user:
Copy file name to clipboardExpand all lines: pl/django_orm/README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ Ups! Wyskoczył błąd. Mówi on nam, że nie istnieje coś takiego jak 'Post'.
41
41
Nic skomplikowanego: importujemy model `Post` z `blog.models`. Spróbujmy jeszcze raz wyświetlić wszystkie wpisy:
42
42
43
43
>>> Post.objects.all()
44
-
[<Post: Mój pierwszy wpis>, <Post: Kolejny tytuł wpisu>]
44
+
<QuerySet [<Post: Mój pierwszy wpis>, <Post: Kolejny tytuł wpisu>]>
45
45
46
46
47
47
Pojawiła się lista wpisów, które dodałyśmy wcześniej! Utworzyłyśmy je przy pomocy panelu administracyjnego Django. Teraz jednak chciałybyśmy dodać nowy wpis używając Pythona. Jak to zrobimy?
@@ -63,7 +63,7 @@ Najpierw zaimportujmy model User:
63
63
Jakich użytkowników mamy w bazie danych? Spróbuj tak:
64
64
65
65
>>> User.objects.all()
66
-
[<User: ola>]
66
+
<QuerySet [<User: ola>]>
67
67
68
68
69
69
To konto administratora, które stworzyłyśmy wcześniej! Teraz uzyskajmy dostęp do naszej instancji użytkownika:
@@ -81,7 +81,7 @@ Teraz możemy wreszcie stworzyć nasz post:
81
81
Hura! Chciałabyś sprawdzić, czy się udało?
82
82
83
83
>>> Post.objects.all()
84
-
[<Post: Mój pierwszy wpis>, <Post: Kolejny tytuł wpisu>, <Post: Przykładowy tytuł>]
84
+
<QuerySet [<Post: Mój pierwszy wpis>, <Post: Kolejny tytuł wpisu>, <Post: Przykładowy tytuł>]>
85
85
86
86
87
87
Jest! Kolejny post na liście!
@@ -135,13 +135,13 @@ Teraz spróbujmy jeszcze raz wyświetlić listę opublikowanych wpisów (wciśni
135
135
QuerySety umożliwiają również porządkowanie list obiektów według określonej kolejności. Spróbujmy uporządkować je według daty utworzenia, czyli zawartości pola `created_date`:
136
136
137
137
>>> Post.objects.all().order_by('created_date')
138
-
[<Post: Mój pierwszy wpis>, <Post: Kolejny tytuł wpisu>, <Post: Przykładowy tytuł>, <Post: Wpis numer 2>, <Post: Mój trzeci post!>, <Post: Czwarty tytuł>]
138
+
<QuerySet [<Post: Mój pierwszy wpis>, <Post: Kolejny tytuł wpisu>, <Post: Przykładowy tytuł>, <Post: Wpis numer 2>, <Post: Mój trzeci post!>, <Post: Czwarty tytuł>]>
139
139
140
140
141
141
Możemy także odwrócić kolejność poprzez dodanie `-` na początku:
142
142
143
143
>>> Post.objects.all().order_by('-created_date')
144
-
[<Post: Czwarty tytuł>, <Post: Mój trzeci post!>, <Post: Wpis numer 2>, <Post: Przykładowy tytuł>, <Post: Kolejny tytuł wpisu>, <Post: Mój pierwszy wpis>]
144
+
<QuerySet [<Post: Czwarty tytuł>, <Post: Mój trzeci post!>, <Post: Wpis numer 2>, <Post: Przykładowy tytuł>, <Post: Kolejny tytuł wpisu>, <Post: Mój pierwszy wpis>]>
Copy file name to clipboardExpand all lines: pt/django_orm/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ Oops! Um erro apareceu. Ele nos diz que não existe algo chamado Post. É verdad
41
41
Isso é simples: importamos o modelo `Post` de dentro do `blog.models`. Vamos tentar mostrar todas as postagens novamente:
42
42
43
43
>>> Post.objects.all()
44
-
[<Post: my post title>, <Post: another post title>]
44
+
<QuerySet [<Post: my post title>, <Post: another post title>]>
45
45
46
46
47
47
É uma lista dos posts que criamos anteriormente! Criamos esses posts usando a interface de administração do Django. No entanto, agora queremos criar novas mensagens utilizando o python, então como é que fazemos isso?
@@ -63,7 +63,7 @@ Primeiro vamos importar o modelo User:
63
63
Quais usuários temos no nosso banco de dados? Experimente isso:
64
64
65
65
>>> User.objects.all()
66
-
[<User: ola>]
66
+
<QuerySet [<User: ola>]>
67
67
68
68
69
69
É o superusuário que criamos anteriormente! Vamos obter uma instância de usuário agora:
Copy file name to clipboardExpand all lines: ru/django_orm/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ QuerySet, по сути, список объектов заданной Моде
41
41
Все просто: мы импортируем модель `Post` из `blog.models`. Давай попробуем получить все записи блога еще раз:
42
42
43
43
>>> Post.objects.all()
44
-
[<Post: my post title>, <Post: another post title>]
44
+
<QuerySet [<Post: my post title>, <Post: another post title>]>
45
45
46
46
47
47
Это список записей, с которыми мы работали до этого! Мы создали их через панель администратора Django. Теперь же, мы хотим создавать записи через Python, так как же мы этого добьемся?
@@ -63,7 +63,7 @@ QuerySet, по сути, список объектов заданной Моде
63
63
Какие пользователи есть в нашей базе данных? Попробуй эту команду:
64
64
65
65
>>> User.objects.all()
66
-
[<User: ola>]
66
+
<QuerySet [<User: ola>]>
67
67
68
68
69
69
Это суперпользователь, которого мы создали ранее! Нам нужен его экземпляр:
@@ -81,7 +81,7 @@ QuerySet, по сути, список объектов заданной Моде
81
81
Ура! Хочешь проверить, что все работает?
82
82
83
83
>>> Post.objects.all()
84
-
[<Post: my post title>, <Post: another post title>, <Post: Sample title>]
84
+
<QuerySet [<Post: my post title>, <Post: another post title>, <Post: Sample title>]>
0 commit comments