All Questions
108
questions
0
votes
1
answer
99
views
How to get null for rows where data doesn't exist in Postgres while performing joins
I have 2 tables: Items and Rates. Items and Rates are linked using a FK on Rates. If the rate of the item is not present for the day then it is not stored. So for item 5 if no rate is present on 1st ...
1
vote
1
answer
397
views
Prefetching extra fields in a ManyToMany table
I am working with Django on a database that has additional fields on intermediate models. Since it's a big database, I try to optimize the way the data is loaded. But I have a problem with the extra ...
-1
votes
1
answer
51
views
Is it good database design?
I have this task to create api:
City district - name, id
Category - name, id
Organization Network - name, id
Organization
Belongs to one of the organization networks
id, name, description
belongs to ...
1
vote
1
answer
319
views
Is there a way to share a common table of database between two django projects without faking it?
I am trying to use a same table across two different projects and want to reflect the changes between them.
Let's assume that there is a student table in the data created by PROJECT1-APP1 of django. I ...
-2
votes
2
answers
118
views
Database relationship between a match and its players
I'm trying to design a database that would save matches and players in a 3v3 game.
So far my models look like this :
class Player(models.Model):
user = models.OneToOneField(User, on_delete=models....
0
votes
3
answers
340
views
Is there a best practice for storing data for a database object (model) that will change or be deleted in the future (Django)?
I am building an order management system for an online store and would like to store information about the Product being ordered.
If I use a Foreign Key relationship to the Product, when someone ...
0
votes
0
answers
25
views
Django: Generating multiple similar tables and link them with another table
I want to store the historical stock price data in a database.
E.g. I want a table which will contain the historical data of AAPL stock. In this table I'll have columns like date, open_price, ...
-1
votes
1
answer
801
views
Questions with multiple choices database schema design
Let's say we want to create a quiz application, where a user can create a quiz with the following characteristics:
Users can select questions for their quiz from a set of predefined questions.
Each ...
0
votes
1
answer
357
views
Sending notification to a specific type of user and save the notification in the database using django channels
I want to send notification to a specific group of users. Let's say the specific group is Admin. When an user register on my site after admin approval the user will be activate. For this admin needs ...
0
votes
1
answer
32
views
which is the better design of database for article Like function?
I'm using Django to develop a news website.Now I'm developing the like function in news detail page, this function is like that at the bottom of the news, there is a like button, once you click it the ...
0
votes
1
answer
45
views
New Entry of Data overwrites all past entries in column , how do i correct this?
Using Django,
when the User fills out the webform, one of the saved Data overwrites all pass entered data for that column. How do i stop it from overwriting it the other past data for that column ?
...
0
votes
1
answer
44
views
Model Design in Django
I have many components and I want to have for each component a list where it shows which users have taken that component and how many of them?
class Component(models.Model):
name=models.CharField(...
-1
votes
1
answer
60
views
Is including the user field in two related models a bad practice? (Django)
I’m fairly new to Django and programming in general.
I’m building a tool for a friend in the construction industry. Basically the client bids for a tender and if they win they sign a contract. A ...
-1
votes
1
answer
183
views
Using Django to filter object values of an attribute based on user-selected values of another object attribute
I have 3 tables which are item, shop and stock
item table consists of
item_id item_name item_price
1 drug AJG 32.00
2 drug BOLS 10.00
3 drug CPP ...
1
vote
2
answers
68
views
How can I constrain or choose between one or other foreign key?
The problem is conceptual (databases relationships), so the language isn't the focus here, but I'm using Python and Django.
I have 3 models/tables:
Company
Customer
Address
Eg.
class Company(models....