Showing posts with the label django-models

[FIXED] sql query or django filter for string

Issue hello i need a query that search in database and return a row that has most similarity from s…

[FIXED] Django - how to specify a database for a model?

Issue Is there a way to specify that a model (or app, even) should only ever use one particular dat…

[FIXED] size date not saving in cartitem model but the product is saving.. Any solution how to save the size data also?

Issue views.py def add_to_cart(request, pk): variant = request.GET.get('variant') …

[FIXED] Django Model isn't migrating even after i saved and added app to installedApps

Issue from django.db import models from django.contrib.auth import get_user_model user = get_user_…

[FIXED] How to get field value in django Model?

Issue I have this code: class Book(models.Model): name = models.CharField(max_length=70) a…

[FIXED] Python Django use mysql function SHA2('pass',256)

Issue I am creating application in Django and now I want create table with username and password. R…

[FIXED] AttributeError at /customers/f0e85ace-438f-4c61-a129-6d5986e6f346/ 'customer' object has no attribute 'get'

Issue I have just started django and struggling to find error. It seems like get() method is not b…

[FIXED] Why the ListView not showing data in the template?

Issue I'm working on my first Django project (the final project for codecademy's Django cla…

[FIXED] model doesn't have migrations

Issue I am working on the Django model. I migrate all the files of the app, but it is showing me th…

[FIXED] Django: Validate file type of uploaded file

Issue I have an app that lets people upload files, represented as UploadedFiles . However, I want t…

[FIXED] Django models DateTimeField index on Date

Issue Is it possible to index only the date aspect of a models.DateTimeField in Django? I cant se…

[FIXED] How to test model labels in Django?

Issue I have the following model.py from django.db import models class Url(models.Model): sho…

[FIXED] What's the difference between select_related and prefetch_related in Django ORM?

Issue In Django doc, select_related()

[FIXED] Django How to generate and save image when entity made with CreateView?

Issue I'm currently developing a django aplication. With one of my models I need to generate a …

[FIXED] django admin specify database (not default)

Issue I am using django admin to facilitate editing a database. Recently, we have added another dat…

[FIXED] How to delete corresponding row with ManyToMany relationship in Django?

Issue I am trying to make a basic pizza app with two API's, toppings and pizzas. When I delete …

[FIXED] how to use image as option in django model form

Issue I am trying to create a form in which I want the user to give some option as an image and the…

[FIXED] Django queryset iteration

Issue I need to iterate through the date entries and want compare them to other dates, but I get on…

[FIXED] How do I display my form in a Django template?

Issue I am trying to display my stat update form in my Django template, however it isn't displa…

[FIXED] Should I use Many-to-one relationship or a Many-to-many?

Issue Basically I am creating a website using django where I have created a class called courses a…