Django Model Properties & Methods | @property decorator | get_absolute_url() method

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

BugBytes

BugBytes

Күн бұрын

Пікірлер: 58
@bugbytes3923
@bugbytes3923 8 ай бұрын
ORM Playlist link: kzbin.info/www/bejne/e6SlonyQordli8U
@amine63404
@amine63404 8 ай бұрын
I like before I Watch. Please more django content. Thank you for all the great content.
@bugbytes3923
@bugbytes3923 8 ай бұрын
Thanks a lot, much appreciated! It'll be a lot of Django in the next month ;)
@amine63404
@amine63404 8 ай бұрын
@bugbytes3923 That's great, we already learned a lot from you. Perhaps you could make a kind of complete course about django with begginer, intermediate and advanced level. I am sure knowing the quality of your job that many people (me included) will be ready to pay for it.
@peterholzer98
@peterholzer98 8 ай бұрын
Thanks a lot and YES please make a video about model managers.
@bugbytes3923
@bugbytes3923 8 ай бұрын
Will do, thanks a lot Peter!
@adkocol
@adkocol 8 ай бұрын
great content, well explained... more django practical hints please :)
@bugbytes3923
@bugbytes3923 8 ай бұрын
Thanks! Coming up soon ;)
@dmitrymikhailovnicepianomu8688
@dmitrymikhailovnicepianomu8688 8 ай бұрын
Great as usual.
@bugbytes3923
@bugbytes3923 8 ай бұрын
Thanks a lot!
@_esplor
@_esplor 8 ай бұрын
Would love to see some processing of data before saving to database/disk. I have a model with filefield for uploading gpx files. I want to save the original file, but also extract metadata into different fields of the model. For example number of points for the track, elevation of each point, calculate the length of the track... I appreciate your django/python content very much. And I hope you will be doing more with django gis, and hopefully "djangorestframework-gis".
@bugbytes3923
@bugbytes3923 8 ай бұрын
Thanks a lot! There will be lots of GIS stuff on this channel in the future, with GeoDjango too - a big part of my working background is in GIS. I'll need to set some time aside to prepare it though, probably over the summer. Are there any GPX file examples that you could point me to for a video like this? I'd be happy to try a small video on this in the near future. Thanks again for the kind words, much appreciated!
@_esplor
@_esplor 8 ай бұрын
@@bugbytes3923 Nice! Much appreciated, let the countdown begin :) I'm a noob in GeoDjango/GIS, even building up models and deciding where to store the data was a struggle. My goal is to setup GeoDjango+rest as a backend for serving hiking tracks and hiking related pois (parking, viewpoints, shelter, fresh water). Maybe using Nextjs as frontend. I know this is a hairy goal for me, but man I'm learning a lot! Let me prepare a gh repo to share. Is it OK for you I make a private GH repo where I can invite you to join?
@developershub2024
@developershub2024 8 ай бұрын
A great content, thank you so much!
@bugbytes3923
@bugbytes3923 8 ай бұрын
Thanks a lot, much appreciated!
@developershub2024
@developershub2024 8 ай бұрын
@@bugbytes3923 Hello, can you please do a video on hxhtml2pdf, PLEASE, because there is a function provided in the documenention about how to Convert HTML URIs to absolute system paths so xhtml2pdf can access those resources, it returns an error, i have tried to find the problem but i havent got the solution, I HOPE YOU WILL CONSIDER THIS!!!!
@leboyoyo
@leboyoyo 8 ай бұрын
Thank you so much for all this useful content!!! Could you please tell me where you're from? I've been following your videos for over a year now, and this accent is starting to drive me crazy!
@bugbytes3923
@bugbytes3923 8 ай бұрын
Thank you for the support! The accent is from Glasgow, Scotland!
@leboyoyo
@leboyoyo 8 ай бұрын
@@bugbytes3923 thanks for the reply :)
@hack727
@hack727 8 ай бұрын
i love your content, please make videos on custom user model, groups and permission and django signals.
@bugbytes3923
@bugbytes3923 8 ай бұрын
Great suggestions, thanks! Will try and prepare soon.
@Yarkanlaki
@Yarkanlaki 8 ай бұрын
I came here after 4h coding Django ❤
@anouarben779
@anouarben779 8 ай бұрын
some django content again, thank you !
@bugbytes3923
@bugbytes3923 8 ай бұрын
Thanks! The next month will be full of Django ;)
@Gbolly_bambam
@Gbolly_bambam 7 ай бұрын
nice content🤯
@bugbytes3923
@bugbytes3923 7 ай бұрын
Thanks a lot!
@ntwarioscar
@ntwarioscar 8 ай бұрын
thanks for your videos but I want to ask you there's video you have done about notification with channels and websocket is it possible to do notofication with django by using htmx, alpine, hyperscript with wsgi or it is not possible? please tell me
@bugbytes3923
@bugbytes3923 8 ай бұрын
I would recommend ASGI + django-channels for this, if possible. Or some other WebSocket package. With WSGI, it is definitely possible, I would think - but I've no experience with that, to be honest.
@seydinaoumarsamabaly1806
@seydinaoumarsamabaly1806 8 ай бұрын
Very great content !
@bugbytes3923
@bugbytes3923 8 ай бұрын
Thanks as always!
@edmfestivals6066
@edmfestivals6066 8 ай бұрын
NO idea what your doing but I love your Scottish accent
@bugbytes3923
@bugbytes3923 8 ай бұрын
Haha glad you like the accent!
@dmitrymikhailovnicepianomu8688
@dmitrymikhailovnicepianomu8688 8 ай бұрын
Can you create video about docker + django? And maybe then deploying a project to Ubuntu. Not on heroku or netlify but to classical clean Ubuntu server. That would be very interesting.
@bugbytes3923
@bugbytes3923 8 ай бұрын
Great suggestion! I've got plans for deployment videos, and deploying to an Ubuntu instance would definitely be interesting. I'll see what I can do soon!
@frameff9073
@frameff9073 8 ай бұрын
good thank you
@bugbytes3923
@bugbytes3923 8 ай бұрын
Thanks!
@kunaltakalkar6647
@kunaltakalkar6647 8 ай бұрын
Thank you for django videos. Can you create a video how to perform each type of sql joins in django...I would be great help
@bugbytes3923
@bugbytes3923 8 ай бұрын
Thanks! Great suggestion, will add it to the list.
@juanbetancourt5106
@juanbetancourt5106 8 ай бұрын
Thank you
@bugbytes3923
@bugbytes3923 8 ай бұрын
Thanks for watching!
@aashayamballi
@aashayamballi 8 ай бұрын
thank you
@bugbytes3923
@bugbytes3923 8 ай бұрын
Thanks a lot for watching!
@piorprogramadorbr9481
@piorprogramadorbr9481 7 ай бұрын
am trying to figure it out, i have a rural and a urban properties, how do i build my models? should i create a models for each of than and them apply a foreing key to a listing models ?
@rns10
@rns10 8 ай бұрын
Hi thanks for this, I have been following this series for quite some time. I would like to know if you plan to also push the code to github.
@bugbytes3923
@bugbytes3923 8 ай бұрын
Thanks! I could put the final models.py file on there, if that would be helpful?
@rns10
@rns10 8 ай бұрын
@@bugbytes3923 Thanks for replying back. Yes that would suffice the need. Thank you.
@anouarben779
@anouarben779 8 ай бұрын
I have a question regarding database management, what is the best way to create database tables for multiple clients (small businesses), is creating a business model enough to separate the databases between them or is there a better practical way ?
@bugbytes3923
@bugbytes3923 8 ай бұрын
I'd recommend a package like django-tenants for separation of tables for each client. This basically works by using a single database, but creating multiple schemas within the database - one per client. Each client can therefore have the same tables, but separated into their own schema. pypi.org/project/django-tenants/ Would a video on this be useful?
@anouarben779
@anouarben779 8 ай бұрын
@@bugbytes3923 thanks for the reply, it sure will be helpful thank you again I appreciate the effort
@kushalpy
@kushalpy 8 ай бұрын
Could you make a latest way on like setting up social logins like with google and facebook using DRF. Many libraries are being broked.
@bugbytes3923
@bugbytes3923 8 ай бұрын
Good suggestion! Will add it to the list.
@SapereAude1490
@SapereAude1490 8 ай бұрын
I never knew about the @property decorator in models - if I were using FastAPI as a microservice and SQLAlchemy, could I do the same? Is it inadvisable to have more complicated methods as @property? Also, for some reason, your accent makes me pay attention better.
@bugbytes3923
@bugbytes3923 8 ай бұрын
Thanks! Yes - properties are something provided by Python classes, so they can also be used with SQLAlchemy in exactly the same manner. I would advise against doing anything too complicated in a property, particularly if it involves reaching beyond the model class for external dependencies or performing additional SQL queries, etc. For simple stuff, it's perfect though.
@Yarkanlaki
@Yarkanlaki 8 ай бұрын
My problem is I can use property for indexing and filtering
@developershub2024
@developershub2024 8 ай бұрын
Hello @bugbytes3923, can you please do a video on hxhtml2pdf, PLEASE, because there is a function provided in the documenention about how to Convert HTML URIs to absolute system paths so xhtml2pdf can access those resources, it returns an error, i have tried to find the problem but i havent got the solution, I HOPE YOU WILL CONSIDER THIS!!!!
@myoji5580
@myoji5580 8 ай бұрын
Problem CharField need blank=True, null=False Because db have two value ‘’, None Confuse read db Restaurant.objects.filter(nickname=‘’) or Restaurant.objects.filter(nickname_isnull=True)
@bugbytes3923
@bugbytes3923 8 ай бұрын
The solution for a CharField would be to disallow Null values, and make the default an empty string.
@DhavalAhir10
@DhavalAhir10 7 ай бұрын
Even though it is a CharField, I prefer to set NULL values on the database side. CharField(null=True) Storing a blank string still constitutes a value, whereas NULL itself signifies the absence of a value. If you store blanks in the database for a CharField where there should be no value, you will end up with various types of empty strings: (i) "" (ii) " " (iii) " " (iv) " " (v) " " It's better to use null=True even with CharField type of field. When you use Django's save method or objects.create() , it checks for values in this sequence for any absent field : First priority: Use the default value if provided in the model field. Second priority: Use NULL if null=True is provided in the model field. Third priority: Use an empty blank string (irrespective of whether blank=True is provided or not), because you can't prevent Django from storing nothing on the database side. Django is frustrated now.
GeneratedField in Django 5 - New Django Model Field!
23:19
BugBytes
Рет қаралды 4,8 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 54 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 17 МЛН
Why You Should Think Twice Before Using Returns in Python
21:27
ArjanCodes
Рет қаралды 36 М.
Django Content Types framework / ContentType model
15:07
BugBytes
Рет қаралды 5 М.
PLEASE Use These 5 Python Decorators
20:12
Tech With Tim
Рет қаралды 125 М.
Django - F Expressions for database-level operations
20:36
BugBytes
Рет қаралды 5 М.
Domain-Driven Design: The Last Explanation You'll Ever Need
21:05
Software Developer Diaries
Рет қаралды 14 М.
DHH discusses SQLite (and Stoicism)
54:00
Aaron Francis
Рет қаралды 103 М.
"Don't Use Fields in C#! Use Properties Instead" | Code Cop #003
10:27
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 54 МЛН