Django Proxy Models - Customizing Model Behaviour using Proxy Models!

  Рет қаралды 4,953

BugBytes

BugBytes

Күн бұрын

Пікірлер: 55
@bugbytes3923
@bugbytes3923 8 ай бұрын
ORM Playlist link: kzbin.info/www/bejne/e6SlonyQordli8U
@kicknotes
@kicknotes 8 ай бұрын
Your channel is really underrated and doesn't have the exposure/views it deserves, imo. Many of the other Django series on YT (even by the more well-known names) are clearly regurgitations of the basic Django docs/tutorials. You on the other hand have a very obvious, deep understanding of Django internals and development in general. Your content is really well-presented at a pace that neither bores nor overwhelms. Very much appreciated, and keep up the excellent work!
@bugbytes3923
@bugbytes3923 8 ай бұрын
Thanks a lot, that's one of the best comments I've had on the channel! Really appreciate it, and I'm glad you're enjoying the content! Thanks again.
@mayanksingh579
@mayanksingh579 7 ай бұрын
@@bugbytes3923 Indeed we are enjoying the content, this is so informative...
@aafan.kuware
@aafan.kuware 9 ай бұрын
best django tutor on youtube so far. I want to become like you bro, please teach me personally on my own project to understand more better. 😅😅😅
@bugbytes3923
@bugbytes3923 9 ай бұрын
Thanks a lot! Happy to try helping if you have any questions. Thanks for watching!
@aafan.kuware
@aafan.kuware 8 ай бұрын
@@bugbytes3923 hi, can you help me in one of my project? I have an hotel commission app live, which show the commission & discount structure to the operation staff, now I wanna implement calculator which will take RATE as input and Commission from the object which is looped in table and gives the Nett amount, I have my view calculating the amount just need help in htmx part.
@aafan.kuware
@aafan.kuware 8 ай бұрын
@@bugbytes3923 can you help me in a django app? i have my code ready just stuck in htmx part.
@LegionLeague
@LegionLeague 9 ай бұрын
This looks like a more flexible and extendable (but potentially more complicated) version of creating a custom manager on the main class itself and just creating methods for custom filtering. Something like this (haven't tested the exact syntax): TaskManager(models.Manager): def todo(self): return self.get_queryset().filter(status=self.model.status.TODO) And query it with Task.objects.todo() With proxy models you'd have to import each of them and add them to the context for rendering in templates.
@bugbytes3923
@bugbytes3923 9 ай бұрын
Good point, this may be a nicer way to do things if the only purpose is for filtering. Thanks for sharing that!
@AmoahDevLabs
@AmoahDevLabs 9 ай бұрын
Nice presentation. This is truely informative. Thanks for your precious time.
@bugbytes3923
@bugbytes3923 9 ай бұрын
Thanks a lot as always!
@todorowael
@todorowael 2 ай бұрын
Thanks for the great explanation! Wish you all the best!
@bugbytes3923
@bugbytes3923 2 ай бұрын
Thank you!
@Yarkanlaki
@Yarkanlaki 9 ай бұрын
Wow I really needed this 😂 a couple thousand line can be removed. Thank you very much
@bugbytes3923
@bugbytes3923 9 ай бұрын
Haha awesome 😂 Thanks!
3 ай бұрын
When you add proxy model, you should add migration too. Django should know that proxy model's base.
@francosbenitez
@francosbenitez 9 ай бұрын
Amazing! I didn't even know about how to run scripts using `runscript`. Thanks!
@bugbytes3923
@bugbytes3923 9 ай бұрын
Thanks a lot! Not sure if I mentioned in the video, this is an extra command added by "django-extensions" - django-extensions.readthedocs.io/en/latest/
@shahbozsharafzoda7441
@shahbozsharafzoda7441 9 ай бұрын
You explain as professional one, as always
@jamoinmoin
@jamoinmoin 9 ай бұрын
I had to use these for the first time just before this video came out, but the video really helped to clear some things up, thanks!
@bugbytes3923
@bugbytes3923 9 ай бұрын
Thanks! Hope it went well for you!
@brianibbotson6492
@brianibbotson6492 9 ай бұрын
Been building a large enterprise ERP product that is based around proxy models as its core entity. Love them!
@bugbytes3923
@bugbytes3923 9 ай бұрын
Interesting use case!
@ayubkara1092
@ayubkara1092 9 ай бұрын
Fantastic as always
@bugbytes3923
@bugbytes3923 9 ай бұрын
Thanks a lot, appreciate it!
@امینجمالی-خ9ص
@امینجمالی-خ9ص 3 ай бұрын
great tutorial Thanks a lottttt
@bugbytes3923
@bugbytes3923 3 ай бұрын
@@امینجمالی-خ9ص thank you!
@Gbolly_bambam
@Gbolly_bambam 8 ай бұрын
you are the best
@bugbytes3923
@bugbytes3923 7 ай бұрын
Thanks so much!
@kushalpy
@kushalpy 9 ай бұрын
Another Master Piece
@bugbytes3923
@bugbytes3923 9 ай бұрын
Thanks a lot as always!
@robhafemeister3100
@robhafemeister3100 9 ай бұрын
Great video! I never thought of using Proxy Models in this way. Just out of curiosity do you create a separate module to keep all of your custom Model Proxies in and then import them as needed?
@bugbytes3923
@bugbytes3923 9 ай бұрын
Thanks Rob! Different ways I might do it, depends on the size of the project - a module for proxies would be a good idea though, to keep them separate from models that represent concrete database tables.
@blees123
@blees123 9 ай бұрын
This is great! Thank you
@bugbytes3923
@bugbytes3923 9 ай бұрын
Thanks a lot!
@ammaryasser4839
@ammaryasser4839 9 ай бұрын
keep going👏
@bugbytes3923
@bugbytes3923 9 ай бұрын
Thank you, will do!
@serychristianrenaud
@serychristianrenaud 9 ай бұрын
Thanks ❤
@bugbytes3923
@bugbytes3923 9 ай бұрын
Thanks a lot!
@aashayamballi
@aashayamballi 9 ай бұрын
Thank you!
@bugbytes3923
@bugbytes3923 9 ай бұрын
Thanks a lot as always!
@frameff9073
@frameff9073 9 ай бұрын
thank you 😍
@bugbytes3923
@bugbytes3923 9 ай бұрын
Thanks for watching!
@youbra4267
@youbra4267 9 ай бұрын
thank you
@bugbytes3923
@bugbytes3923 9 ай бұрын
Thank you!
@shahbozsharafzoda7441
@shahbozsharafzoda7441 9 ай бұрын
Later, could you please make video about multi language for django project?) Thanks for your informative videos, Sir!
@rajatarora8693
@rajatarora8693 8 ай бұрын
Hey, can you please make a video on how to implement User-Role based access control?
@davidl.e5203
@davidl.e5203 9 ай бұрын
How would that be different from creating a new model and using the base model as a foreign key? Example: class Task(models.Model): id = models.Integer() class TaskStatus(models.Model): task = models.ForeignKey(Task)
@r75shell
@r75shell 6 ай бұрын
It's silly that you haven't show what will print(Task.objects.all()) show in the end for Completed tasks.
@abbasebadian6851
@abbasebadian6851 20 күн бұрын
Person ❌ Persian✅
@seydinaoumarsamabaly1806
@seydinaoumarsamabaly1806 9 ай бұрын
Thank You!
@bugbytes3923
@bugbytes3923 9 ай бұрын
Thanks a lot mate!
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
Express.js Middleware, Router, & Body-Parser
35:49
SimpleCodeCraft
Рет қаралды 132
Django REST Framework series - Setup and Models
22:14
BugBytes
Рет қаралды 9 М.
Django Database Transactions / atomic() function
34:15
BugBytes
Рет қаралды 6 М.
Django - select_for_update() function / Locking Database Rows
23:36
Django Conditional Expressions / Case() and When() objects
36:26