Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть Querysets and Django Shell

  • Code master
  • 2016-10-11
  • 9130
Querysets and Django Shell
Querysets and Django ShellDjango Querysetdjango querydjango shellunknowndjango queryset tutorialdjango python shellqueryset djangodjango orm tutorialdjango database querydjango querysetsdjango cmsdjango join queriesdjango models shelldjango database shelldjango manage shelldjango model querydjango orm queryorder_by djangopython django shellpython manage.py shell
  • ok logo

Скачать Querysets and Django Shell бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно Querysets and Django Shell или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку Querysets and Django Shell бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео Querysets and Django Shell

In this tutorial we will learn how to query the database. This step is very important and it may be a bit boring but if you understand how to query I database in Django you basically will never have any issues with django.

We will use the django shell to query the database. We will grab post that we already created, create new post and even delete some post so lets get started.

Let's fire up the django shell.
1. python3 manage.py shell
2. Since our post our tied into the user auth framework we will need to query that database as well so we will need to import the data base
'from django.contrib.auth.models import User'. Now we have access to the Users database.
3. Now we want to have access to our post model so we need to import that as well
'from blog.models import Post'
4. Now we want to have access to the Users post so we have to query the database for them.
'user = User.objects.get(username='admin')'
5. Now we want to create a new post.
'post = Post.objects.create(title='third post', slug='third-post', content='third post content', author=user)'
6. Now we have created a new post but we still have to commit it to the database which we will do with a simple onliner.
'post.save()'
7. How to do we get the post.
Post.objects.all()
8. Modify objects
post.title = 'This is a new title'
post.save()

9. Order post in alphabetical order
Post.objects.order_by('title')
order post in reverse order
Post.objects.order_by('-title')

10. delete a post
post = Post.objects.get(id=2)
post.delete()

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]