relationship

Access linked to sql server with relationships and lookup values

Hi all, I have a sql server database that several websites use. Now the customer wants this to be linked to an Access2007 program. Ive created a datasource file etc and have the tables linked to the database just fine. What I need is for the relationships between the tables to be able to create dropdown lookups so that when a user wants...

SQLAlchemy - relationship limited on more than just the foreign key

I have a wiki db layout with Page and Revisions. Each Revision has a page_id referencing the Page, a page relationship to the referenced page; each Page has a all_revisions relationship to all its revisions. So far so common. But I want to implement different epochs for the pages: If a page was deleted and is recreated, the new revision...

Define tables from a part of my ER Diagram.

I have a ER-Diagram (Show in http://www.4freeimagehost.com/show.php?i=f82997ca4d5d.png). In the diagram you see 2 entities and a 1:N relataion together. Project has 2 columns as ProjectID, ProjectName. Employee has 3 colums as EmployeeID, EmployeeName and ProjectID. A project has ONLY 1 project-manager and project-manager is a employee. ...

Rails accepts_nested_attributes_for and build_attribute with polymorphic relationships

The core of this question is where build_attribute is required in a model with nested attribuites I'm working with a few models that are setup like: class Person < ActiveRecord::Base has_one :contact accepts_nested_attributes_for :contact, :allow_destroy=> true end class Contact < ActiveRecord::Base belongs_to :person has_on...

iPhone Core Data relationship fault

Hi, I am building a core data iphone app, and having trouble with retrieving one-many relationship data. Please bear with me while I explain. I have used the data model designer to setup an entity called "Item" that contains many entities called "Comment". I then retrieve multiple entities and display them in a UITableView. I fetch the...

Core Data Beginner...

does someone know where i can find example to do that case ? 2 entities : Catalogue of books and Books. One relation to-Many between. I found many tuto to explain how to make appears A book of selected catalogue (tableview) but none for a "double" tableview which is simple i suppose. The first tableview will present all the book's catal...

LINQ to SQL Basic question - table relationships

I'm playing with an image gallery in ASP.NET MVC, and trying to get my head around LINQ to SQL at the same time. I have 3 tables to hold image gallery data, with a many-many relationship through a link table. These are : Gallery (Id, Name, Description) Image (Id, Title, Description, FileName) GalleryImage (Galle...

Need some explanations on NHibernate many to one relationships

Hello everybody, would you mind help me to better understand what to do with the relationship between my entities and NHibernate? I have some difficulties to understand what operations I need to do by hand, and what operations NHibernate will do for me (or not). I have these 2 entities: public class Position : BaseEntity<int, Positio...

Django reverse relationship problem

I'm trying to write a reverse relationship for taking the number of answers asociated to each question, but all i get is 'Negative voting' repeating as many times as the question is voted negatively, and i don't get why it doesn't display the number of votes instead of that. my code: {% for object in object.voteupanswer_set.all %} Posit...

Zend Framework: count() returns 1 on empty result with findManyToManyRowset(...)

Hi :) While working on a small shop application i fetch all colors of an article using Zend Framework's "findManyToManyRowset" functionality. Example: $colors = $article->findManyToManyRowset('Shop_Colors', 'Shop_ArticlesToColors'); Some of the articles don't have and colors assigned. I test it using count($colors) on the ...

Find by association (Datamapper)

I've got two models that look like this class Stage include DataMapper::Resource property :id, Serial belongs_to :staff end class Staff include DataMapper::Resource property :id, String, :key => true property :full_name, String property :email, String has n, :stages end I'm trying to find all Stages that hav...

How can I get back the relationship data in RoR?

I have something like this: class Employee < ActiveRecord::Base has_one :office end class Office < ActiveRecord::Base belongs_to :employee # foreign key - employee_id end If I want to edit the employee, at this form what can I fo to edit the office data? <% form_for(@employee) do |f| %> <%= f.error_messages %> ...

Move Child Rows to new Parent FK ID ?

SQL Server 2008. I have a parent row with pk id 1. While blocking all other DB users (this is a cleanup operation so resource contention is not an issue), I would like to insert a new row, then take all of the child rows and change their fk column to the new row. With the below DDL for example, I would like to insert a new row and give ...

How can I loop back all the category in Ruby on Rails??

OK, assume that I have a post table, and a category table. This is the model look like: class User < ActiveRecord::Base acts_as_authentic has_many :posts end and, that is the post models: class Post < ActiveRecord::Base belongs_to :user end And this is the new.html.erb from post: <% form_for(@post) do |f| %> <%...

Retreive one row from 1 to many relationship between three tables

I have the following three tables : ----PRODUCT---- PRODUCT_ID DESC 1 'Pencil' 2 'Paper' ----PRICE_BY_SUPPLIER---- PRODUCT_ID SUPPLIER_ID PRICE 1 1 10 1 2 9 1 3 9.5 2 1 5 ...

Sectioning on Core Data relationship for a UITableView

I have 2 entities - BlogEntry and BlogComments. BlogEntry.comments is a "to many" relationship to BlogComments | BlogEntry | ----------------- | subject | | body | | comments (rel)| | BlogComments | ------------------ | commentText | | blogEntry (rel)| Now, I have a tableview that I want to be able to have ...

Creating a data object relationship system

I would like to store an object that has a name and some attribute and any kind of database and have another that that document relationship between between them Let say this Object A Object B Object C Object D A is related to B A is related to D B is related to C All relation have also attribute that give the relation order (uni (fr...

How to join 2 models in rails, which are not really in any relationship?

I have 3 models, say Account, Comment and Status. Each Account will have many Comment and Status, but Comment and Status are not in any kind of relationship. I would like to query the Account's Comment and Status, and sort these comments and status by time. How can I make this? Thanks all. ...

How do I access the properties of a many-to-many "through" table from a django template?

From the Django documentation... When you're only dealing with simple many-to-many relationships such as mixing and matching pizzas and toppings, a standard ManyToManyField is all you need. However, sometimes you may need to associate data with the relationship between two models. For example, consider the case of an application...

Core Data - Setting a Relationship

Hello, I have a problem with Core Data which has left me at the end of my tether. So I was wondering if any of you wonderful people could help. Basically, I have two entities in a Core Data project. These are: Author {authorName, dateOfBirth} Book {bookName, pages} There is a one-to-many relationship from author to books called 'auth...