Django Admin Actions - Writing Custom Actions for the Django Admin

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ก.พ. 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!

  • @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!

  • @ahmednaseem5161
    @ahmednaseem5161 6 หลายเดือนก่อน +3

    Very detailed series on Django ❤

    • @bugbytes3923
      @bugbytes3923  6 หลายเดือนก่อน

      @@ahmednaseem5161 thank you!

  • @khalidseflan301
    @khalidseflan301 6 หลายเดือนก่อน +1

    Thank you for your efforts and you deserve all support.

    • @bugbytes3923
      @bugbytes3923  6 หลายเดือนก่อน

      Many thanks for your support!

  • @AmoahDevLabs
    @AmoahDevLabs 6 หลายเดือนก่อน

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

    • @bugbytes3923
      @bugbytes3923  6 หลายเดือนก่อน

      Thanks as always man!

  • @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!

  • @hernansaa
    @hernansaa 6 หลายเดือนก่อน +1

    great video! thanks again.

    • @bugbytes3923
      @bugbytes3923  6 หลายเดือนก่อน

      Thanks a lot!

  • @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!

  • @divanshusoni3704
    @divanshusoni3704 5 หลายเดือนก่อน +1

    great, thankyou 💖

    • @bugbytes3923
      @bugbytes3923  4 หลายเดือนก่อน +1

      Thanks for watching!

  • @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!

  • @abderahimlamamri8591
    @abderahimlamamri8591 6 หลายเดือนก่อน +1

    very nice topic, thanks

    • @bugbytes3923
      @bugbytes3923  6 หลายเดือนก่อน

      @@abderahimlamamri8591 thanks for watching!

  • @Man-si9xf
    @Man-si9xf 6 หลายเดือนก่อน +1

    The best.

    • @bugbytes3923
      @bugbytes3923  6 หลายเดือนก่อน +1

      Thanks a lot!

  • @frameff9073
    @frameff9073 6 หลายเดือนก่อน

    thank you

    • @bugbytes3923
      @bugbytes3923  6 หลายเดือนก่อน

      Thanks for watching!

  • @Developer_python_
    @Developer_python_ 6 หลายเดือนก่อน

    I learnt it at mt work

  • @ibrahimoglu
    @ibrahimoglu 6 หลายเดือนก่อน

    👍👍

    • @bugbytes3923
      @bugbytes3923  6 หลายเดือนก่อน +1

      Thank you!

  • @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.

  • @АвоМама
    @АвоМама 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.

  • @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  6 หลายเดือนก่อน +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!