Ok i have this controller:
class ExampleController extends AppController {
var $name = 'Example';
public function test_me () {
$this->Example->Create();
$this->Example->set( 'variable_from_db_1' => 'random_value_1',
'variable_from_db_2' => 'random_value_2' );
//here, how can i...
Deploying to sharepoint using the object model or STSADM commands sometimes results in one or more packages being in the "error" state in the web control, a redeploy instantly fixes this, usually, even stranger, if i create two apps one which adds and one which deploys then i get no problems, but putting a delay between a single program ...
I have some players and the players have a trade state. Rather than hard code trade states like "active" and "inactive" and then have to go looking for strings, I thought I'd be clever and have a separate TradeState model so that a Player has a trade_state_id (a Player can be in only one trade state at a time).
Now, it would be a conve...
I have a hierarchy of classes that all derive from a base type and the base type also implements an interface. What I'm wanting to do is have one controller to handle the management of the entire hierarchy (as the actions exposed via the controller is identical). That being said, I want to have the views have the type specific fields on ...
Hi,
I'm trying to use JQuery's $.getJSON to access Model data from the Controller, and build a JSON object in the javascript to use as the user adds and removes items from a list. All JS is done in an external file. The hit to the server for the Model data is done only once after the page first loads so I can get the full list of option...
Hi All,
I'm using ASP.NET MVC and would like to get Model information for use within my javascript. I've strongly typed the view, and thus am able to use <%= Model.Name %> within my HTML to get Model data.
But once I'm in the <script> tags, I get no intellisense (in Visual Studio) when using <%, and the information doesn't seem to be r...
Let's say you're implementing rails app for a snowboard rental store.
A given snowboard can be in one of 3 states:
away for maintenance
available at store X
on loan to customer Y
The company needs to be able to view a rental history for
a particular snowboard
a particular customer
The rental history needs to include temporal dat...
which means, can i change the result of find() to another model using sth like:
<?php
fields = array('sum(vote.score) as Post__score_sum'),
?>
and return:
array(
'Post'=> array(
'score_sum' => 5
)
);
related: http://stackoverflow.com/questions/1611311/cakephp-pagination-sort-data-out-of-model
...
Hello,
I have a model where I need to do some processing before saving (or in certain cases with an edit) but not usually when simply editing. In fact, if I do the processing on most edits, the resulting field will be wrong. Right now, I am working in the beforeSave callback of the model. How can I tell if I came from the edit or add...
Hi, I am having some issues with CakePHP's find() method and conditions in 'deeper' model associations. There are some of these around but I could not find an answer to this so far.
My model associations are User hasMany Post hasMany Comment hasMany Vote and Vote belongsTo Comment belongsTo Post belongsTo User respectively. The belongsT...
I started creating a domain model and now I asking myself, how can I map this domain model to a NHibernate Data Model ((using Fluent NHibernate)? Is there anywhere a good and simple example of how to do that?
With Data Model I didn't think about the physical/relational Database Model(!) What I meant was the Data Model in the Data Access...
I am new to rails so could use some help here. I have followed several tutorials to create a blog with comments and even some of the AJAX bells and whistles and I am stuck on something that I hope is easy. The default display for both blogs and comments is to list the oldest first. How do I reverse that to show the most recent entries an...
Hi
I've fitted a VECM model in R, and converted in to a VAR representation. I would like to use this model to predict the future value of a response variable based on different scenarios for the explanatory variables.
Here is the code for the model:
library(urca)
library(vars)
input <-read.csv("data.csv")
ts <- ts(input[16:52,],c(200...
I'm in a databases course and the instructor wants us to develop an e-commerce app. She said we can use any framework we like, and now that we're halfway through the semester she decided that Rails does too much and wants me to explicitly write my SQL queries.
So, what I'd like to do is to write my own functions and add them to the mode...
Hi there,
We are experiencing some problems with our google mini and I need to know what model we're using as referenced here http://code.google.com/apis/searchappliance/documentation/52/troubleshooting/Designing%5FSearch%5FSolution.html#Queueing
Our google mini is racked and the label seems to be underneath it, so it's not easy to fin...
For my assignment I need to develop FSP model for email server and client. I manage to write simple model which describes one user, server and his mailbox, but I am having problems changing this system into one which have two users with two separate mailboxes.
The FSP model that I have developed:
USER = (read->USER | write->USER).
SERV...
Hey SO,
I'm making a website with two different databases. Let's say one is DB1, and the other is DB2. I've set up my database.php in the config folder, so they each have the correct host/password/username/database etc with db['DB1']['hostname'] and the other db['DB2']['hostname'] etc, so I'm pretty sure I've got that part right.
Acc...
I was recently listening to an interview with Joe Hewitt (Facebook iPhone app creator) and he mentioned that most important portion of an application these days is the core model. He goes onto say that the reason for this is that apps need to be built for every platform but stem from a single core (web, mobile, and 3rd party apps).
I...
I have the following scheme: My site is a trivia game, so every Question "hasMany" Answers, but a Question also "hasOne" correct Answer that is also represented by the Answer model.
I have yet to test this, but my programmer's instinct tells me that the retrieved array will be kind of redundant and it will not separate the correct Answer...
Id like to create a model in rails that does not correlate to a table in the database. Instead the model should dynamically pull aggregrate data about other models.
Example:
I have a Restaurant model stored in the restaurants table in the DB. Id like to have a RestaurantStats model where i can run a RestaurantStats.find_total_visitors...