Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
jmconfuzeus
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
13 ms
·
91.
▲
by
jmconfuzeus
5y ago
Django's ORM is one of the best out there but you'd be surprised to know how many people don't know about things like prefetch_related. There are whole DjangoCon conference talks that go in length into these features even tho
92.
▲
by
jmconfuzeus
5y ago
I agree. A warning should be the minimum because I don't see why anyone would consider hitting the database when accessing template context normal.
93.
▲
by
jmconfuzeus
5y ago
If my payment logic is getting too coupled, I can easily extract it because I use one migration file per model and separate code using regular Python packages. I can easily extract the logic into it's own app if I need to publish it to
94.
▲
by
jmconfuzeus
5y ago
I'm sorry you didn't find it useful. No need to dissuade others from reading it, especially beginners, because it will help them write better Django code.
95.
▲
by
jmconfuzeus
5y ago
You'd be surprised how many developers are working on Django projects right now who have never written a line of SQL in their entire lives. Instead of thinking about data and business logic, they're preoccupied by code and separat
96.
▲
by
jmconfuzeus
5y ago
You pulled only the good ones. Where are the migrations named 0019_auto_20181224.py?
97.
▲
by
jmconfuzeus
5y ago
I consider them harmful for beginners who need to start working on non trivial production code. Multiple apps are definitely good for the admin but what I was advocating isn't 100% avoidance of apps but to avoid creating apps for every
98.
▲
by
jmconfuzeus
5y ago
I never said that people need to stop using Django. It's still my favorite framework and will continue to be. I just wanted to point out some mistakes that many beginners make and that I made when I first started. Personally, I think D
99.
▲
by
jmconfuzeus
5y ago
Good point! Django is full of surprises like this and it would take an eternity to enumerate all of them. inb4 some grumpy guy shoots me down for claiming that his favorite framework isn't perfect.
100.
▲
by
jmconfuzeus
5y ago
Many developers never look at the SQL panel in debug toolbar. That's why I'm advocating to evaluate QuerySets before presenting any data. It's just a way to make less mistakes.
101.
▲
by
jmconfuzeus
5y ago
I wrote this post for beginners and most of them never read the docs before hacking on production code. Lazy querysets aren't dangerous but it's always best to evaluate them before rendering anything in order to avoid secret SQL q
102.
▲
by
jmconfuzeus
5y ago
It's easier to notice expensive SQL queries in the view vs in the template. Anyone who claims that it's fine to run queries in templates has smoked something really good. Personally, I'll continue to aggregate all my data usi
103.
▲
by
jmconfuzeus
5y ago
No need to hash password if you subclass AbstractUser. Tell me, if I have {{ customer.auth_user.email }}. Where in this line of code does it say that a SQL query is going to be performed? So much love for lazy queries eh. You're so new
104.
▲
by
jmconfuzeus
5y ago
1. How are you supposed to change the concrete User model that Django provides without forking Django itself? It's 1000x better to subclass AbstractUser and provide your own User model that you own. 2. One migration file per model is e
105.
▲
Harmful Defaults in Django
(confuzeus.com)
55 points
by
jmconfuzeus
5y ago
|
79 comments
106.
▲
by
jmconfuzeus
5y ago
Scrolling on this web page is really annoying.
107.
▲
by
jmconfuzeus
5y ago
VSCode is pretty barebones. You'll need to setup a language server and figure out how to search everywhere and also learn grep in the process if you don't know it already. In Webstorm, you just press on Shift twice and a popup app
108.
▲
Effective ways to model polymorphism in Django
(confuzeus.com)
1 points
by
jmconfuzeus
5y ago
|
0 comments
109.
▲
by
jmconfuzeus
5y ago
SEEKING WORK | Mauritius | Remote Fullstack Django developer with experience in devops. Looking for opportunities in SaaS and CMS based projects. Email me michael@confuzeus.com for a quick intro.
110.
▲
by
jmconfuzeus
5y ago
There's a "through" argument for the ManyToManyField that allows you to specify a custom model to track relationships. Then there's InlineModelAdmin that allows you to integrate your relationships in the admin. You gave
111.
▲
by
jmconfuzeus
5y ago
Sounds like you built something for yourself instead of building something that the market wants. Every non technical person I've spoken with loves Wordpress and Squarespace for good reason.
112.
▲
by
jmconfuzeus
5y ago
They don't want to build the whole interface but they sure want to move things around and try out pages with different layouts. The goal is to allow them to ship marketing experiments as quickly as possible. With Jamstack, they always
113.
▲
by
jmconfuzeus
5y ago
Not just Git, marketing people also hate headless CMSes because they're hard to use and make it more complicated to try new things out. You have to use different tools to build forms, pages, and track users. Even as a developer I think
114.
▲
by
jmconfuzeus
5y ago
Jamstack sounds good on paper but it causes too much trouble for marketing people. The role of a website is to do marketing and if your marketing people can't easily work with it then it's a failure of a website.
115.
▲
by
jmconfuzeus
5y ago
There's also Coffeezilla and Spencer Cornelia. We need more people to talk publicly about these things so that less and less people can get scammed.
116.
▲
by
jmconfuzeus
6y ago
How did you do that?
117.
▲
by
jmconfuzeus
6y ago
This is one of the reasons why I'm moving to Rails. Frontend work is quite hard with templates and most of the community has moved towards Reactjs because of that, which I don't like. I think they designed it this way because they