Introduction to SQLAlchemy for Django Developers

Поделиться
HTML-код
  • Опубликовано: 29 ноя 2024

Комментарии • 9

  • @aashayamballi
    @aashayamballi 2 года назад

    It was very informative, Thank you! 🤝

  • @rar000000000
    @rar000000000 3 года назад

    I have a question if you don't mind. I worked a bit with sqlalchemy in another framework, but am new to Django and I need to implement sqlalchemy so that I can transfer my code from both frameworks. At 5:35 you have: "from app.extensions import db"
    Where does that come from? Every tutorial online that I've been through starts with that already importing from "extensions" but I have no idea what that refers to. Apologize if it seems like a dumb question, but I appreciate any help

  • @localboyvijay9628
    @localboyvijay9628 3 года назад +1

    Most useful

  • @karansmittal
    @karansmittal 3 года назад +1

    Bro your content is just awesome and very useful. There are some things though I think you can improve. the voice, for example, I think it's a bit low.

  • @robirobi4404
    @robirobi4404 3 месяца назад

    Am I hearing it wrong or is he saying Djanga instead of Django?

  • @mma93067
    @mma93067 2 года назад +1

    All I’m hearing is django’s orm beats sqlalchemy out of the water 😂

  • @yureeek2067
    @yureeek2067 3 года назад

    Hi, thanks for the video. It is soo useful!!
    I only start with sqlAlchemy, what can you say about this approach?
    I would like to have extendable and reusable queries.
    def get_articles_query(self, filter_data: ArticleFilter) -> sqlalchemy.orm.query:
    """Get articles query with default filter"""
    stmt = self.session.query(Article)
    if filter_data.plan_id:
    stmt = stmt.filter(Article.plan_id == filter_data.plan_id)
    ...
    # apply a lot of filtering
    return stmt
    def get_active_articles_by_user_query(self, user: User, filter_data: ArticleFilter) -> List[Article]:
    """Get active articles by user"""
    articles = self.get_many_articles_query(filter_data)
    articles = articles.join(User).filter(User.user_id == user.id)).filter(Article.is_active=True)
    return article.all()

  • @pravinsamgir1092
    @pravinsamgir1092 3 года назад +2

    stop moving here and there while explaining it shows nervousness and lack of confidence

    • @programming1734
      @programming1734 3 года назад +3

      Stop sitting behind a screen and typing.