Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

django-models

Django ORM returns non-iterable object

August 22, 2022 by Magenaut

The model is

Categories Python, Q&A Tags django, django-models, django-orm, django-queryset, python Leave a comment

How to query as GROUP BY in django?

August 21, 2022 by Magenaut

I query a model:

Categories Python, Q&A Tags django, django-models, python Leave a comment

What is the difference between null=True and blank=True in Django?

August 21, 2022 by Magenaut

null=False, blank=False: This is the default configuration and means that the value is required in all circumstances.

Categories Python, Q&A Tags django, django-models, python Leave a comment

Django dynamic model fields

August 21, 2022 by Magenaut

I’m working on a multi-tenanted application in which some users can define their own data fields (via the admin) to collect additional data in forms and report on the data. The latter bit makes JSONField not a great option, so instead I have the following solution:

Categories Python, Q&A Tags django, django-custom-manager, django-models, dynamic, python Leave a comment

How do I filter query objects by date range in Django?

August 21, 2022 by Magenaut

I’ve got a field in one model like:

Categories Python, Q&A Tags django, django-models, django-queryset, python Leave a comment

Convert Django Model object to dict with all of the fields intact

August 20, 2022 by Magenaut

How does one convert a django Model object to a dict with all of its fields? All ideally includes foreign keys and fields with editable=False.

Categories Python, Q&A Tags dictionary, django, django-models, django-orm, python Leave a comment

What is a “slug” in Django?

August 20, 2022 by Magenaut

When I read Django code I often see in models what is called a “slug”. I am not quite sure what this is, but I do know it has something to do with URLs. How and when is this slug-thing supposed to be used?

Categories Python, Q&A Tags django, django-models, python, slug, url Leave a comment

Django. Override save for model

August 20, 2022 by Magenaut

Before saving model I’m re-size a picture. But how can I check if new picture added or just description updated, so I can skip rescaling every time the model is saved?

Categories Python, Q&A Tags django, django-models, python Leave a comment

Django set default form values

August 20, 2022 by Magenaut

I have a Model as follows:

Categories Python, Q&A Tags django, django-forms, django-models, python Leave a comment

What’s the difference between select_related and prefetch_related in Django ORM?

August 20, 2022 by Magenaut

In Django doc,

Categories Python, Q&A Tags django, django-models, django-orm, python Leave a comment
Older posts
Page1 Page2 … Page6 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress