relationships Questions

11

Simplified, I have the following class structure (in a single file): Base = declarative_base() class Item(Base): __tablename__ = 'item' id = Column(BigInteger, primary_key=True) # ... skip oth...
Adina asked 1/2, 2012 at 0:8

12

Solved

Using CakePHP: I have a many-to-one relationship, let's pretend it's many Leafs to Trees. Of course, I baked a form to add a Leaf to a Tree, and you can specify which Tree it is with a drop-down b...
Necrophobia asked 9/10, 2009 at 19:57

14

Solved

Is it possible to create/delete different databases in the graph database Neo4j like in MySQL? Or, at least, how to delete all nodes and relationships of an existing graph to get a clean setup for ...
Bozuwa asked 21/12, 2010 at 10:56

3

Solved

I'm expanding my application and I need to join two models I had previously created with Sequelize, they are as follows: Meal sequelize.define('meal', { mealId: { type: DataTypes.INTEGER, pri...
Dimeter asked 28/6, 2016 at 17:45

6

Solved

Is there a way to merge 2 relationships in laravel? this is the way it's setup now, but Is there a way I could return both merged? public function CompetitionsHome() { return $this->HasMany(...
Extrasystole asked 12/6, 2014 at 12:11

2

Solved

I have two main tables with relationships many to many and a pivot table. Model 'Type' public function attributes() { return $this->belongsToMany('App\Attribute', 'attribute_type'); } Mo...
Leonardoleoncavallo asked 10/5, 2016 at 20:7

3

I was under the impression that when I use a belongsTo relationship in my model, it will return the object but I seem to only get the id. Is this supposed to happen and what is the benefit of this?...
Slate asked 15/10, 2014 at 23:52

3

I know this question has been asked before on Stack Overflow, but the answers aren't doing it for me in ways I can explain. My general approach was inspired by this tutorial. What I'm trying to do...
Penetration asked 15/5, 2016 at 22:21

3

Solved

In Laravel 4; I have model Project and Part, they have a many-to-many relationship with a pivot table project_part. The pivot table has a column count which contains the number of a part ID used on...
Acetamide asked 1/2, 2015 at 20:35

3

Solved

I am a little fuzzy about Core Data Relationships deletion rules. So if someone could help me answer a few questions about them. I have Entities A and B. A has a to-Many relationship with B, and B...
Georgiageorgian asked 25/3, 2015 at 12:13

1

Solved

So I've got a couple of models which I'm setting up for use with Laravels Eloquent ORM... The tables these models refer to are populated by a third party program, which I do not have much ability ...
Syphilis asked 24/2, 2017 at 23:16

1

Solved

I am trying to make a simple follower/following system in laravel, nothing special, just click a button to follow or unfollow, and display the followers or the people following you. My trouble is ...
Nkvd asked 4/7, 2017 at 20:8

0

Our project has following requirements- User can be part of multiple projects A project can have multiple users. User can be either Owner or Admin or Viewer of a project. Obviously there can only...
Architecture asked 30/5, 2017 at 15:43

3

Solved

I have this (simplified) table structure: users - id - type (institutions or agents) institutions_profile - id - user_id - name agents_profile - id - user_id - name And I need to create a prof...
Ration asked 27/4, 2017 at 21:24

1

Solved

My query is like this : <?php public function getListReviews() { $reviews = Review::where('user_id', auth()->user()->id) ->get(); return $reviews; } From the query, it can get all...
Miscegenation asked 7/3, 2017 at 6:37

2

Solved

I have the following database scheme: table 'products' id category_id and of course a category table, just with an id. The data look something like that: Products -------------------- | id | c...
Studious asked 18/5, 2013 at 15:37

2

Solved

I have the next code for two classes: public class Object { public int ObjectID { get; set; } public int Object2ID { get; set; } public virtual Object2 Object2 { get; set; } } public class Ob...
Kondon asked 17/9, 2014 at 16:11

4

I have two models with parent-child relationship: training and exercise: App.Training = DS.Model.extend({ exercises: DS.hasMany('App.Exercise') }) App.Exercise = DS.Model.extend({ training: DS....
Theressathereto asked 4/2, 2013 at 10:45

4

Solved

I have two MongoDB collections user and customer which are in one-to-one relationship. I'm new to MongoDB and I'm trying to insert documents manually although I have Mongoose installed. I'm not sur...
Prink asked 2/12, 2014 at 10:43

4

I have the following entity (only relevant mappings shown): @Entity @Table(name = "PQs") public class PQ implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Colum...
Dermatoplasty asked 11/10, 2011 at 23:30

1

I have a model Post which has a hasMany('Comments') relationship. I would like to fetch all Posts with the Comments relationship, but only the latest one comment for each Post. And because there ar...
Bridgid asked 23/9, 2014 at 20:44

1

Solved

I am using the 'state_machine' gem. Once I create a new UserFriendship, the user_id and friend_id do not get saved. I even tried creating manually the friendship in the console by passing the user_...
Martinsen asked 1/11, 2015 at 4:44

1

I am trying to set up django-import-export to handle my data which is stored in spreadsheets. The spreadsheets don't contain foreign keys as IDs, but rather they contain the (also unique) names of ...

0

I have a setup which look something like this class Topic(db.Model): __tablename__ = 'topic' id = db.Column(db.Integer, primary_key=True) parent = db.relationship( 'Topic', secondary='parent...
Piggish asked 4/9, 2015 at 16:57

1

Here's an example to set up my question. I have a model which contains 'boxes', and they have a REST endpoint: /boxes, /boxes/{boxId} This model also contains 'nodes': /nodes, /nodes/{nodeId} N...
Orbiculate asked 1/9, 2015 at 20:9

© 2022 - 2024 — McMap. All rights reserved.