Learnlog

Learnlog

1151 bookmarks
Custom sorting
Create OneToOne instance on model creation
Create OneToOne instance on model creation
7 View upvote and downvote totals. This answer is not useful Save this answer. Show activity on this post. An excellent django-annoying plugin solves this for you with AutoOneToOneField
The most common way to accomplish this is to use the Django signals system.
·stackoverflow.com·
Create OneToOne instance on model creation
How to split django groups into subsets
How to split django groups into subsets
Instead of subclassing groups, I recommend adding a GroupType model that will have a many to many relation to group.
·stackoverflow.com·
How to split django groups into subsets
Speed up Django Nested Foreign Key Serializers w/ prefetch_related
Speed up Django Nested Foreign Key Serializers w/ prefetch_related
Works beautifully, but the only problem? We’re making *tons* of DB calls like this. For every module we have, we’ll make one extra DB call with obj.lessons.all() , and for every lesson we have, we’ll make one extra DB call with obj.exercises.all() .
·medium.com·
Speed up Django Nested Foreign Key Serializers w/ prefetch_related
Utilizing docstrings
Utilizing docstrings
When your file is correctly documented, just use the jsdoc CLI to create your documentation.
·stackoverflow.com·
Utilizing docstrings
Integrate MDX with a single tool and less boilerplate. Manage content with type-safe data and helper functions. | delba.dev
Integrate MDX with a single tool and less boilerplate. Manage content with type-safe data and helper functions. | delba.dev
The ability to use React.js components inside markdown is the main motivation for using MDX. You can use the useMDXComponent() hook to render the current posts "MDX enriched" markdown
Which Contentlayer (using a bundler under the hood) transformed into JSX and cached as static json
·delba.dev·
Integrate MDX with a single tool and less boilerplate. Manage content with type-safe data and helper functions. | delba.dev
Use an environment file in Docker Compose
Use an environment file in Docker Compose
Single-quoted (') values are used literally
Compose supports parameter expansion in environment files. Parameter expansion is applied for unquoted and double-quoted values. Both braced (${VAR}) and unbraced ($VAR) expressions are supported.
·docs.docker.com·
Use an environment file in Docker Compose