Django Admin Actions - Writing Custom Actions for the Django Admin

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

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

  • @bugbytes3923
    @bugbytes3923  2 месяца назад +1

    ☕ Buy a coffee: ko-fi.com/bugbytes
    ⭐Top resource to learn Python - datacamp.pxf.io/kOjKkV ⭐

  • @iwswordpress
    @iwswordpress 6 месяцев назад +2

    It is awesome that your channel covers areas others don't. Thanks.

    • @aafan.kuware
      @aafan.kuware 6 месяцев назад

      yes, definitely.
      he had consumed Django as cocktail drink. 😊

    • @bugbytes3923
      @bugbytes3923  6 месяцев назад +1

      @@iwswordpress thanks a lot!

  • @khalidseflan301
    @khalidseflan301 6 месяцев назад +1

    Thank you for your efforts and you deserve all support.

    • @bugbytes3923
      @bugbytes3923  6 месяцев назад

      Many thanks for your support!

  • @ahmednaseem5161
    @ahmednaseem5161 6 месяцев назад +3

    Very detailed series on Django ❤

    • @bugbytes3923
      @bugbytes3923  6 месяцев назад

      @@ahmednaseem5161 thank you!

  • @AmoahDevLabs
    @AmoahDevLabs 6 месяцев назад

    It's always great to have you here giving us gist on Django and other great stuffs. Thanks for sharing.

  • @mrmuranga
    @mrmuranga 6 месяцев назад +1

    thanks as always🙂 ...always learning from you

    • @bugbytes3923
      @bugbytes3923  6 месяцев назад

      Thank you - glad to hear that, and thank you for commenting!

  • @imthatchris
    @imthatchris 6 месяцев назад +1

    I’d certainly appreciate extra information on celery within django. Great video, big fan of the content

    • @bugbytes3923
      @bugbytes3923  6 месяцев назад

      Thanks a lot! Really keen to do some Celery stuff soon, it's on the cards!

  • @gibbson130
    @gibbson130 6 месяцев назад

    Excellent as always!

  • @Developer_python_
    @Developer_python_ 6 месяцев назад +5

    Dear author we need a big topics :
    1 Everything about forms with details
    2 Customising admin panel with details
    THANKS!!!

    • @bugbytes3923
      @bugbytes3923  6 месяцев назад

      I'll look into these, thanks!

  • @hernansaa
    @hernansaa 6 месяцев назад +1

    great video! thanks again.

  • @divanshusoni3704
    @divanshusoni3704 4 месяца назад +1

    great, thankyou 💖

  • @abderahimlamamri8591
    @abderahimlamamri8591 6 месяцев назад +1

    very nice topic, thanks

    • @bugbytes3923
      @bugbytes3923  6 месяцев назад

      @@abderahimlamamri8591 thanks for watching!

  • @agastronics
    @agastronics 6 месяцев назад

    Chat GPT did something like this for me while trying to achieve this that's the first time I learned about it.
    Thanks to GPT thanks to you too ❤🎉

    • @bugbytes3923
      @bugbytes3923  6 месяцев назад

      @@agastronics thanks a lot!

  • @Man-si9xf
    @Man-si9xf 6 месяцев назад +1

    The best.

  • @devestavel
    @devestavel 6 месяцев назад +1

    Please do a series about django admin. For me, Django Admin is one of the best features of all frameworks available. It is extremely under used. The docs are hard, and customizing it is not obvious...

    • @bugbytes3923
      @bugbytes3923  6 месяцев назад +1

      @@devestavel thanks for the suggestion, I’ll consider this soon!

  • @SmartC2007
    @SmartC2007 6 месяцев назад +1

    Thanks a lot for the video. As always very interesting.
    I have a quick question: How much of a "bad practise" is it, to create model admin actions, which are not related to the queryset / the selected model objects? E.g. if I have a model with many entries and I want to delete all entries older than six months from the current date. I could write a admin actions for this. Or is there a better way of doing such thing? I would need to select one object, to make the action work, but it would work ... Thanks or your time.

    • @bugbytes3923
      @bugbytes3923  6 месяцев назад +1

      Thank you!
      Interesting question - I would say a better way to approach that would be to create a scheduled task that runs once per day, and removes any entries older than 6 months. That would avoid having to start the task via an admin action, where you need to select a random object to trigger the task.
      However - I just released a video on django-unfold (an admin theme for Django). I didn't cover this in the video but it provides different "action types" on top of the default Django action mechanism. Here's a link:
      github.com/unfoldadmin/django-unfold?tab=readme-ov-file#actions
      Note the Global option: "General actions for model, without selecting specific instances"
      So this would be possible that way, too, and might be easier to setup if you're not already using a task queue like Celery.

    • @SmartC2007
      @SmartC2007 6 месяцев назад +1

      @@bugbytes3923 Thanks a lot - I will have a look at it.

  • @frameff9073
    @frameff9073 6 месяцев назад

    thank you

  • @ibrahimoglu
    @ibrahimoglu 6 месяцев назад

    👍👍

  • @АвоМама
    @АвоМама 6 месяцев назад

    Could you show how intermediate pages can be used to add a tag to several products, which can be selected from a list or created a new one?

    • @bugbytes3923
      @bugbytes3923  6 месяцев назад

      I'll add a quick follow-up on intermediate pages soon.

  • @Developer_python_
    @Developer_python_ 6 месяцев назад

    I learnt it at mt work

  • @hernansaa
    @hernansaa 6 месяцев назад

    would it be to much hassle to be able to modify lets say, the status, directly in the row field as a dropdown select?

    • @bugbytes3923
      @bugbytes3923  5 месяцев назад +1

      It would potentially be possible, yes. However, for more complex actions (including side-effects), I think the action function is possibly a better approach.

  • @alexdin1565
    @alexdin1565 6 месяцев назад

    thanks for sharing, please can you make a video on how we can change default admin dashboard using tailwind or customer CSS because its ugly

    • @alexdin1565
      @alexdin1565 6 месяцев назад

      i commented before watching full video, waiting the admin dashboard

    • @aafan.kuware
      @aafan.kuware 6 месяцев назад

      and I like his videos before watching it full. 😅

    • @bugbytes3923
      @bugbytes3923  6 месяцев назад

      @@alexdin1565 coming up in the next video, using a tailwind admin theme!