Questions tagged [many-to-one]
1040 questions
-1
votes
1 answer
Django - How to display a attribut (name) from forgeinKey object?
I have an artist which has many paintings, so a many to one relation. So i got
class Artist(models.Model):
name = models.CharField(max_length=120)
age = models.IntField()
class Paintings(models.Model):
painting =…

Dariun
- 327
- 3
- 14
-1
votes
1 answer
Symfony 4 relation many-to-one and cascade persit
I have a problem with a many to one relationship.
Here I have a Client entity that already exists. Then I try to link Documents to this entity.
I have a document creation form with a selector that lists my clients. There are no problems.
But when I…

wehtam
- 39
- 3
-1
votes
1 answer
Status: 415, error: "Unsupported Media Type" - for POST request OneToMany - ManyToOne relation
I've been trying to solve this problem for 2 days, I've read everything and tried a lot of options, but nothing happens and I can not see where I'm wrong.
I just have to add a table entry that merges 2 other tables. I apologize for the long…

Nikolay Pavlov
- 55
- 5
-1
votes
1 answer
How to use a many2one field in Odoo 12?
I have two class in python file (odoo version is 12):
class Module_procede(models.Model):
_name = 'moduletest.procede'
pr = fields.Char("firstname", default='???', required=True)
mp = fields.Char("lastname", required=True)
class…

Programmer LiLi
- 147
- 5
- 27
-1
votes
1 answer
Passing Entity object value in to nested CollectionTypes in a Symfony4 form
Overview: Foreach VariantGroup in a Products VariantSets I need to create a dropdown containg that VariantGroups Variants in the Symfony form
Details:
I have a Product entity which is associated as a ManyToMany relationship to multiple VariantSet…

DevLime
- 937
- 2
- 9
- 19
-1
votes
1 answer
Set email as foreign key in Odoo 10
I have a model named Joked and I wish to store the email of the current user as foreign key. In my model I have defined my M2O relationship as shown:
last_accessed_by = fields.Many2one('res.users', string='Complainant id', default=lambda self:…

Mingg Lex
- 151
- 3
- 12
-1
votes
1 answer
Spring Data JPA How to update data in table
In spring data jpa ,I am trying to update data into account table.for update json data is coming from Angular Application.that json data is not present in one table. for example sdepname column not present is account table,sdepname column is in…

SpringUser
- 1,351
- 4
- 29
- 59
-1
votes
1 answer
Many customers interacting with one support phone, via one Twilio number
Need suggestions in solving a problem.
I'm attempting to duplicate what I’ve observed in the Nordstrom Twilio SMS/MMS showcase example on the Twilio web site. It’s very cool. I too want to build a server/client app that will work with Twilio SMS to…

Snow Man AK
- 19
- 2
-1
votes
1 answer
Learning Django - models.py ForeignKey or ManyToManyField or else?
Trying to get some Django skills. I would like to have a class with one field being multiplied. So I can have more then one connected to my main class with an option of being active or not (for future needs).
So my subclass would look something like…

Jan Mejor
- 141
- 3
- 15
-1
votes
2 answers
Scala: Data structure for the representation of 1:1, 1:M, M:1, and M:M relationships between objects of the same type
In comparative genomics, the identification of orthologous genes [which are genes that are believed to have similar function] in two genomes is important in a variety of applications. The relationship between these genes from the two genomes can be…

7kemZmani
- 658
- 1
- 8
- 21
-1
votes
1 answer
Deleting child entity from set in parent class
I am trying to attach image files to an entity called product. I can create a product along with the image pretty well but when i try to delete an image i get the following error.
HTTP 500 - Request processing failed; nested exception is…

user3676579
- 21
- 3
-1
votes
2 answers
JPA OneToMany Relationship - foreignkey is not set
I send data to server with ajax post
var obj = {
'sub': 'this is a test.'
,'userName': 'dbdyd'
,'saveDate': new Date()
,'comments': [
{'comment':'1a', 'saveDate2': new Date(), 'seq2': null}
,{'comment':'2b',…

Yong Yu
- 1
- 2
-1
votes
1 answer
JPA Delete the "one" in a Many-to-One relation
I have these two classes:
@Entity
public class Tag {
@Id @GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, mappedBy = "parent")
private List…

Ya Bü
- 21
- 5
-1
votes
2 answers
One-To-Many and Many-To-One relationships in Django
I have a class Environment that has a list of Video objects (relationship One-To-Many), and in the class Video, i have a relationship with Environment of Many-To-One.
How to express this in Django?

WitaloBenicio
- 3,395
- 5
- 25
- 32
-1
votes
1 answer
Django: m2o relation to a m2m table
I have a default m2m relationship between Stage and Pipeline (without through model).
I have another model (StageHistory) that needs a m2o relationship with the data saved on the table created by the m2m relationship stage-pipeline.
So what i…

joao
- 97
- 1
- 10