About 50 results
Open links in new tab
  1. python 3.x - Casting inside a django query - Stack Overflow

    Oct 11, 2021 · Player.objects.aggregate(Avg('score')) This will not work because "score" is a CharField and needs to be cast to a float first. How do I go about typecasting it on the fly? …

  2. Django: ordering numerical value with order_by - Stack Overflow

    from django.db import models from django.db.models.functions import Cast class Address(models.Model): street_number = models.CharField() class Meta: ordering = [ …

  3. python - Casting objects in django model - Stack Overflow

    Apr 12, 2013 · If I understood your concept of "cast" it will not work in the way you described. However, to get model inheritance to work you need to use abstract models (see docs) class …

  4. django.db.utils.ProgrammingError: cannot cast type uuid to integer

    django.db.utils.ProgrammingError: cannot cast type uuid to integer Asked 5 years, 7 months ago Modified 1 year, 4 months ago Viewed 16k times

  5. Django: Cast CharField to Integer if possible - Stack Overflow

    Django: Cast CharField to Integer if possible Asked 5 years, 8 months ago Modified 5 years, 8 months ago Viewed 2k times

  6. Django error: cannot cast type date to time without time zone

    May 2, 2021 · Django error: cannot cast type date to time without time zone Asked 4 years, 7 months ago Modified 2 years, 11 months ago Viewed 10k times

  7. django - Type casting in python - Stack Overflow

    May 21, 2012 · This breaks the model of object oriented programming. If someone else is using your code and they decide to derive from your class, they can't effectively do it. Try to work …

  8. 'ProgrammingError: cannot cast type bigint to uuid' in Django

    Feb 28, 2024 · 'ProgrammingError: cannot cast type bigint to uuid' in Django Asked 1 year, 9 months ago Modified 1 year, 9 months ago Viewed 602 times

  9. python 2.7 - conversion of datetime Field to string in django …

    Jun 13, 2013 · 19 extra is deprecated in Django 2.0 That's why I think the best solution to get a stringified datetime is:

  10. Django ORM - Cast and filter a queryset - Stack Overflow

    Dec 10, 2019 · 2 I would like to cast a related column to integer and then filter a queryset, but I can not get it to work. These are my models