Questions tagged [m2m]

A type of relationship between entities of types A and B which associates a list of entities of type B to an entity of type A and vice versa. Types A and B may be the same type

A type of relationship between entities of types A and B which associates a list of entities of type B to an entity of type A and vice versa. Types A and B may be the same type.

See also:

271 questions
0
votes
2 answers

Search M2M fields by names not by id in django

I need have a search box, one of fields of the model has a M2M field. I got to put it works but only works when i look for the id of the M2M field, not for the name. my models: class Specialities(models.Model): name =…
dfrojas
  • 673
  • 1
  • 13
  • 32
0
votes
1 answer

How to access django m2m self through model

This is my model: class Store_product(models.Model): breakdown_lst = models.ManyToManyField('self',symmetrical=False,through='Kit_breakdown_assoc',related_name='kit_lst') class Kit_breakdown_assoc(models.Model): kit =…
user3105117
  • 1
  • 1
  • 3
0
votes
1 answer

Avoid Django def post duplicating on save

Hi I'm facing issues of duplicated objects when saving. How can I prevent that? Thanks in advance. #models.py class Candidate(models.Model): user = models.OneToOneField(User, primary_key=True) birth = models.CharField(max_length=50) …
Ronaldo Bahia
  • 576
  • 3
  • 24
0
votes
1 answer

Get related field m2m django though

Hi I'm new in Django and I'm not getting the related object in the through model. My code: #models.py class Candidate(models.Model): user = models.OneToOneField(User, primary_key=True) birth = models.CharField(max_length=50) ... class…
Ronaldo Bahia
  • 576
  • 3
  • 24
0
votes
2 answers

Django manytomany through create form and view

I'm new in Django and I'm building a job board. But I don't understand how to create a form to get related fields of a M2M through. Here is my code: #views.py class JobDetails(generic.DetailView): model = Job template_name =…
Ronaldo Bahia
  • 576
  • 3
  • 24
0
votes
3 answers

Which protocol can be used for M2M communication in IoT?

I am working on Contiki OS based platform development for IoT.I want to implement M2M in IoT. Let say , i have one sensor and one switch.Now i want to trigger switch based on threshold of sensor readings.I can achieve this easily.But i want some…
0
votes
1 answer

How to create m2m relationship in PowerPivot

So I am trying to link an employee metrics pivot chart with an employee project table with one slicer. I want an employee slicer that manipulates all charts but the data is coming from 2 different places (SQL, Sharepoint). When I try to create a…
user3486773
  • 1,174
  • 3
  • 25
  • 50
0
votes
1 answer

django tables 2 accessing m2m

I have two models: class Hi(models.Model): name = models.CharField(max_length=2) class Hello(models.Model): name = models.CharField(max_length=50) his = models.ManyToManyField(Hi) I am trying to render Hello model. Thus I have…
pynovice
  • 7,424
  • 25
  • 69
  • 109
0
votes
2 answers

Selecting relation with exact keys in a many to many

I have an M2M relation on two tables in an SQL database, as follows: Players ------- Name ID Teams ------ Name ID PlayersTeams ------ PlayerID TeamID A team consists of 1 or more players. I would like to query for a team given its player IDs, and…
market
  • 473
  • 1
  • 4
  • 9
0
votes
0 answers

SSAS cube has no data

I was making new enhancements to SSAS cube and in the process have 'broken' the cube. Meanwhile, I have deleted all the new dimensions and facts I had added from DSV. Saved and processed dimensions and cube few times with no luck. :( I have checked…
SKa
  • 51
  • 11
0
votes
1 answer

Modify objects in an m2m relation in Django

I want to add attributes in objects, which included m2m filed. models.py class GamerQuestion(models.Model): gamer = models.ForeignKey(User) question = models.ManyToManyField(Question) test = models.ForeignKey(Test) view.py for…
0
votes
0 answers

Best way to create or update a through related set in Django?

I'm relatively new to Django and having some trouble with a through table relationship. I've looked at the documentation and can't find a good way to update a set without a ton of DB calls. class Business(models.Model): customers =…
BWStearns
  • 2,567
  • 2
  • 19
  • 33
0
votes
1 answer

Update existing M2M relationship in Django

I'm trying to save an existing instance of a customer record. Its model has a M2M to the vehicle model (since a customer can multiple vehicles). After reading several questions/answer here, I still do not know how to solve this. Customer…
Rmartin
  • 243
  • 3
  • 6
  • 14
0
votes
3 answers

Order Django queryset by two concatenated M2M fields

I have the following Django models (greatly simplified here): class Author: name = models.TextField() class Editor: name = model.TextField() class Publication: authors = models.ManyToManyField(Author) editors =…
Charl Botha
  • 4,373
  • 34
  • 53
0
votes
1 answer

Applied security

Background Terminals are a compination of hardware and software. Terminal's main responsibility is to - collect data (with it's sensors) - process and transmit collected data to data server over the Internet. The terminal has Internet access either…
secman
  • 1