Data dodania Pytanie
2018-02-15 17:02 Does overriding an abstract base class attribute affect other child classes? »
If I change the attribute of an abstract base class field like Classname._meta.get_field(fieldname).attribute = 'value' will it affect the other ch...
(1) odpowiedzi
2018-02-14 16:02 Fast moving average computation with Django ORM »
We run Postgres 9.6.5 and Django 2.0. We have a Model with fields created_at and value. We need to calculate a 90-day moving average for a certain dat...
(3) odpowiedzi
2018-02-11 13:02 Abstract user django migration error »
I am trying to add two fields to user model of Django. Migrations and models are: from django.contrib.auth.models import AbstractUser class User(Abs...
(0) odpowiedzi
2018-02-10 10:02 type char exceed 10485760 limit error still showing after I change the limit to something less than MAX »
I have a django app, I'm migrating it's database from sqlite3 to postgres, i get the following error line since i got a field in one of the models set...
(1) odpowiedzi
2018-02-09 23:02 Images in my create view not working django »
This is my view and it is saving the data but not the image. How to resolve it? def DoubtCreate(request): if request.method == 'POST': if not r...
(1) odpowiedzi
2018-02-08 11:02 How can I filtering objects of a model that their foriegn keys are not null in django? »
I have these two models: class Questions(models.Model): question_text = models.CharField(max_length=200) pub_date = models.DateTimeField('dat...
(3) odpowiedzi
2018-01-31 15:01 how to set default group for new user in django? »
how can I set default group for new users that I create? I didn't create custom model of user and My django version is 1.11. ...
(1) odpowiedzi
2018-01-31 07:01 Django annotation is not working with order_by »
I want to get last 100 records of MyModel order_by('-end_date') and do a SUM annotate on different winner types them MyModel.objects.all()[:100].orde...
(1) odpowiedzi
2018-01-27 15:01 Conditional Django Model Creation »
I am writing a app for django which i am planning to publish. This app requires a Bolean Setting variable CONSUMER_REGISTRATION. Aim of getting this...
(1) odpowiedzi
2018-01-26 08:01 Django and ManyToMany fields »
I have a database in mysql and I am setting up a django project. I have some entities with many-to-many relations, which are handled through associati...
(1) odpowiedzi
2018-01-26 01:01 How to access the a reverse relation of a reverse relation django »
I am determined to try get all the other users that replied to the same comment as a given reply. I have come up with the following python, however I ...
(3) odpowiedzi
2018-01-21 03:01 How do I list columns not inherited from base classes? »
I have this class: class DataCommonInfoText(models.Model): a_col = model.TextField() def is_data(self): return True class Meta: ...
(1) odpowiedzi
2018-01-20 07:01 Django filter based on custom function »
I have a table AvailableDates with a column date that stores date information. I want to filter the date after performing some operation on it which i...
(2) odpowiedzi
2018-01-15 08:01 django datetime declaration error »
I added the following code in models.py : class Conference(models.Model): conf_name = models.CharField(max_length=250) location = models.Char...
(1) odpowiedzi
2018-01-10 16:01 Django ManytoMany filter exact list with duplicate items »
This is extension for the question Django ManytoMany filter exact list Looks like accepted answer doesn't work when list contains duplicates. Is ther...
(1) odpowiedzi
2018-01-08 07:01 Querying the Database | Django »
Here's my models, class Question(models.Model): question_text = models.CharField() class Answer(models.Model): question = models.ForeignKey(...
(0) odpowiedzi
2018-01-06 17:01 Django Database create_or_update error »
So the definition for the pcaps table is : class Pcaps(models.Model): uuid = models.CharField(max_length=50, unique=True) filename = models.C...
(1) odpowiedzi
2018-01-06 06:01 NOT NULL constraint failed error when populating foreign key field »
I'm trying to run a script I wrote to move some data from json files into my database, and keep getting the same error. Traceback: Traceback (most r...
(1) odpowiedzi
2018-01-06 01:01 How to upload files to database? »
This is my models.py from django.db import models # Create your models here. class Houses(models.Model): owner = models.CharField(max_length=25...
(0) odpowiedzi
2018-01-03 15:01 Inner classes - Inheritance and overriding their attributes »
I'm trying to understand how Django uses python's metaclasses for it's database models (options) and came up with the following stripped down code sni...
(1) odpowiedzi
2017-12-27 21:12 Remove data from the database when the remove button of a datatable is clicked »
I am using a datatable to dispay information for the user and it is generated a delete button per row. I would like to delete the row data from the d...
(1) odpowiedzi
2017-12-25 20:12 Django - Getting AttributeError 'User' object has no attribute 'cleaned_data' while cleaning form data »
I was trying to make a user registration page in Django. everything went fine. but when I submit the form data I get this below error AttributeErr...
(1) odpowiedzi
2017-12-24 07:12 Django build video website similar to YouTube »
I am trying to build a video upload, view, sharing website using Softwares : Django 1.11.8 Django Rest Framework 3.7.3 Python 3.6.3 Backend Data...
(1) odpowiedzi
2017-12-21 17:12 How to increment a numeric string in Python »
I've spent the last two days trying to figure out how to increment a numeric string in Python. I am trying to increment a sequence number when a reco...
(2) odpowiedzi
2017-12-21 14:12 Django custom manager`s method that changes data works incorrectly with other manager`s methods (filter, get, etc.) »
I have created a custom Manager, but in my case its method adds some string to the end of particular field in a model instead of just filtering querys...
(2) odpowiedzi
2017-12-19 21:12 DJANGO: TemplateDoesNotExist: auth/user_confirm_delete.html »
I'm trying to create a "delete account" functionality in Django. I use DeleteView for this purpose. The problem is that after calling this view, Dja...
(1) odpowiedzi
2017-12-18 12:12 Do I need a many-to-many relationship for the leave approver of a company? »
I have a: User and Company class User(AbstractBaseUser): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length...
(1) odpowiedzi
2017-12-18 09:12 Equality of Django's Q objects »
I am trying to compare django's Q objects which are composed in the exact same way. But despite all children and relations between them being same, t...
(1) odpowiedzi
2017-12-16 20:12 Ordering by sum of difference »
I have a model that has one attribute with a list of floats: values = ArrayField(models.FloatField(default=0), default=list, size=64, verbose_name=_(...
(2) odpowiedzi
2017-12-14 01:12 Django cannot determine queryset for chaining one-to-many with one-to-one relationship »
I have a system where there is a many to one relationship with a number a model (say 1 a -> many b) and that many model has a one to one relationship ...
(2) odpowiedzi
2017-11-26 23:11 Django - filtering by user »
I want to render data from the Route model that belongs to the Driver in their 'accounts' page - so displaying the leave_from, destination etc data th...
(3) odpowiedzi
2017-11-18 21:11 Django add a relation between the user and the selected articles »
I have a simple model Article. The model is: class Article(models.Model): title = models.CharField() text = models.TextField() likes = mo...
(2) odpowiedzi
2017-11-18 09:11 KeyError: 'locations' in Django app »
I'm working on a Django application which fetches JSON data from an API and stores it in PostgreSQL database. But while migrating the app I'm getting ...
(1) odpowiedzi
2017-11-11 17:11 Extending the Django 1.11 User Model »
I am attempting to work out how to extend the Django user model to add information to a user. I can't seem to get it to work. What am I doing wrong?...
(1) odpowiedzi
2017-11-08 15:11 How to Use get_absolute_url() with a foreign key object in Django template »
Am relatively new to django and I have searched for this problem but couldn't find a solution. Forgive me if the solution is obvious but I just can't ...
(1) odpowiedzi