I have been spending some time getting up to speed with views 2 and I really like it so far. Looking at the code, it seems that this module along with drupal can be used to build generic database applications (I have a feeling there is some kind of industry buzzword for this but I am not sure what it is). What I am hoping to do here with Drupal 6 and Views 2 is have a database somewhere (not necessarily the drupal database) that is collecting some kind of data, then with a custom drupal module that leverages the views 2 API I can create CRUD for the data in this database, and provide a number of custom "views" of the data.
As a specific example lets say that I have an accounting database. This database has a number of tables, the most interesting one being an expense table. I have figured out how to create a view that filters the expenses by date and tags, but now what if I want to show a summary of this view above the display of the detailed view. The summary would have total expenses per tag and maybe a graph that takes it's input from xml, a database resource handler, or an array representing the selected rows generated by the view.
Both the summary and the detailed view are related to each other. They come from the same set of data, that is the same rows. But the summary is a different view of this data.
My question is how would I go about creating and displaying this summary view along with the detailed view? I am guessing I would create a separate view for the summary and then embed it in the header of the detailed view, but maybe there is a way to access this information as the detailed view is building the output? This summary view is kind of a detailed display though (it's a type of page view, but it's more detailed then that, it has components that will be displayed as rows, and the graph is totally different). Do I create a new display plugin that will generate this summary? Or is this a theming issue?
Regarding the data for the summary view, would I refer to expense per tag as a virtual row, and create a view handler for it? The sql is something like
select sum(value),tag from expense group by tag
Any suggestions on the best way to think about using drupal 6 and views 2 for writing generic database applications would be useful!
-Dennison Williams

Comments
using prepending attached displays for summaries
Hi.. i've just thought about your words and personally i'd vote for using a separate display for a summary.
To combine two views you could use display attachments. An attachment could also be prepended to a page view. that would result your described result with a summary header, still defining the page as the standard criteria.
Finally the only impact is on page execution there's no gain of this coupling since the summary query would get always executed separately.
Hope this image helps.
simple database application
Hi,
I was wondering if anyone has made any progress on a module for simple CRUD operations on a database. I too am conceiving of an application that manages different types of entities and its attributes in a simple to use Drupal app. I've been looking for a module that provides this but having no luck.
Looking for something that provides an interface for specifying the db, the tables and fields that I want, what's editable, what's not, etc.
I appreciate any pointers in the right direction.
Thanks,
Batla
sure - here's a quick/demo
sure - here's a quick/demo module I a while ago- not up to D6 yet: http://drupal.org/project/object_driver
it has no Views integration and crappy output but it does generic CRUD for objects that map to a single table.
have you tried table wizard?
have you tried table wizard? http://drupal.org/project/tw
There is another project like that as well floating around.