So , I am trying to make an register and login system . I want to customize it using the custom user model , where I can save my data and extend the model. I am
I want to have a default value in my django model response value Sample model query myModel.objects.filter().values("username", "user_gender") I want to have a
models.py def upload_org_logo(instance, filename): ts = calendar.timegm(time.gmtime()) filepath = f"Timesheet/org_logo/{ts}" if instance: b
If I want to describe some information such as ordering, if the model is proxy or abstract, which fields must be unique together, then I need to put this inform
Im novice and I didnt find solution for this problem. Im writing code for a blog. I have a model Post where I want to create field author which is ForeighKey to
can any one help me with assigning value to a foreign key field. Im trying to create user profile where user can add there countries. when creating the models,
Suppose I have an object: survey = Survey.objects.all().first() and I want to create a relationship between it and a group of objects: respondents = Respond
I am currently building a Django app that requires two different user types and I know that storing authentication information across multiple models/tables is
To display objects (members) in particular order, I have made a field, order: order = models.IntegerField(unique=True,null=True,blank=True) so that I can do an
I'm trying to replicate this model from here: https://github.com/Davidham3/ASTGCN/tree/master/model but when I try to run the model code in my colab import torc
I have a model named "Product" and it has an attribute like price, quantity, and remarks. Thru the models.py, if remarks has a property of "null=True", it will
How to retrieve the data from Django queryset for use in a variable When an output is received in below form after running the query <QuerySet [{'name': 'J
I'm creating my blog with django, and trying to make posts urls in slug way, after I created the models and called it in views it showed me this error: [TypeErr
models.py class Organisation(models.Model): """ Organisation model """ org_id = models.AutoField(unique=True, primary_key=True) org_name = m
I am creating a quiz app using Django. The requirements are: I need to first display all the topics available for the quiz on the homepage. Clicking on a partic
i looked at other questions regarding this issue and their problems were in the REST_FRAMEWORK = ... values in settings.py file . is there any error in mine ? I
So i want to upload file but only sent to locals storage NOT DATABASE too. But i don't know how to make custom forms. suddenly, here's my models.py : from djang
How do i solve the above error which shows up not during the makemigrations but during migrate in Django. class Comment(models.Model): #comment_id=models.I
I have a table column A=['1','2','3'] and I want filter from the table if the filter value is exist in the list. eg: id='1' Models.objects.filter(A=id)
I have a model class myModel(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete = models.CASCADE,null=True) start_price = model