Hi,

I have been asked to develop a web based application for storing data. I have been given a data model. For example, there is a company with many employees, each employee might handle many accounts but each account might be handled my many employees. Each account might relate to many customers. Etc etc. The basic requirement is that users will be able to log in a naviage and view the data.

I thought since I have done a few simple sites in Drupal, I might use it as a base for what I am doing.

Is there a specific module you know of that is good for this? Would you suggest creating a module from scratch? Or using some other infrastructure alltogether?

Thanks!!
G

Comments

gordonbooker’s picture

I can't really help you and would be interested in knowing the best way of doing this myself. I was however trying to do this a while back and ended up doing it by making new tables in the database and accessing them through drupal by having some php and mysql code on the nodes to display and order the data. There was a drupal function that I used that allowed me to use the pager - so all the data didn't have to be on one page.

WorldFallz’s picture

i would just do this with straight drupal-- creating content types for each particular group of data (employees, customers, accounts, etc), using cck fields for the different info on those content types, then using the views module to create the various listings of data to present to the users. You could use one of the node relationship modules to create the relationships, but I like the nodereference and nodereferrer cck field types modules.

===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime."
-- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz

xkater’s picture

hey worldfalz - i know this is old, but do you still prefer Nodereference and Nodereferrer cck field over Node Relationship?

and an aside, would you contribute to a 'how to set up a relational database, including examples' documentation push?

many thanks

amandawolfe’s picture

I'm actually trying to do something similar--basically I need to be able to sort data (users and their content) so that a group of editors can see them and take actions. I'm in the process of creating Views to do just that (the add-on Views Calc is a big help in this, because it allows you to calculate stuff based on a view table's column). I'm also eagerly awaiting the Views Bonus Pack port to D6, because it comes with a CSV exporter that would be super helpful. (I'd try to help but alas I am not a developer--sometimes I dearly wish I were!). There's also another module I've found that isn't ready for prime time yet on D6, but I have my eye on it because it seems like another possiblty perfect solution. It's called Advanced User Details. This might not be quite right for you project because it allows filtering of users based on account and profile data. But just in case it's helpful, I'll throw that name in the ring too. :)

And last but not least, there's webform (which allows you to make surveys etc.) and webform report, which gives many built in tools for viewing/sorting the data.

Oy! Lots of possibilities, none of them quite perfect. But at least it might help get you started. (Can you tell I've been actively researching this for a few weeks? :)) HTH!

aneuryzma’s picture

How did you solve in the end ?

I'm actually interested about the "relational" part. I've been able to import the database but I dunno how to determine relationships between fields in Drupal.

i.e. assigning a post to a user
assigning a answer node to a question node

Radiating Gnome’s picture

I've created a few similar sites -- a movie review site and a project management site. Most of what you need is in CCK and views, although some other contrib modules help dress it up a little.

The relationships between nodes are handled with user reference and node reference fields. You can leverage these connections in views using relationships -- it's very powerful, but does take a bit of work to get your head in there to figure it out.

So, for my time tracking site, I have these content types:

Project
task
timeticket.

and they're connected in this way:
when a task is created, it gets a nodereference connection to a project.
when a timeticket is created, it gets a nodereference connection to a task.

The prepopulate module adds functionality that will take url variables to pre-populate fields in the form, so I can create a custom link on the node-task.tpl.php page template that allows the user to click "create a new ticket" while they are on the task page, and prepopulate the task field.

and so on. Once you get this down, you can start creating views with block displays, so you can display a list of associated tasks on each project page, and associated timetickets on each task page, etc.

User references can be used in much the same way.

Once you start node-referencing your content types together, your relational database can really take shape.

-rg

summit’s picture

Hi,
I read your posts and want to simulate a sort of relational database also using drupal.
I have a working site with nodes and reviews on these notes using node reference.

But in this particular case I would like to add more than one reference (may be six?) to a node referencing other child nodetypes.
First, is there a limit how many nodes can interact in a parent-child relation using node reference?
Second, you where saying: "when a task is created, it gets a nodereference connection to a project". Did you add some special code in the node reference field to get this done?

greetings,
Martijn

EVB123’s picture

I have already created a relational database in MySQL/phpMyAdmin. It is normalised (ID numbers link entries in tables from Primary Key to Foreign Key).

Do you know how I can import my existing database and if I can, can these IDs be directly used as node references? (i.e. are node references integers) and how would I establish the relationships?

Any links which might help would be greatly appreciated.

Thanks very much

peterjlord’s picture

Think probally https://www.drupal.org/project/migrate depending on how much content you have.
You will need to create some custom code to map the relationships.