model

Database and web service models

I'm watching the 2010 Google I/O video on this topic and I have a few questions to make sure I understand properly. Google I/O 2010 - Android REST client applications Please note I also have a very limited understanding of CursorAdapters Right now my application just has a UI layer. I've created an object called DbAdapter using some ...

Can I only generate base classes when calling Doctrine::generateModelsFromYaml()?

I am using Doctrine::generateModelsFromYaml(). It creates a directory filled with base classes. Cool. I'm guessing the point of separating the base classes is to store only column definitions and relationships (in other words, only things that can be gleamed from the DB. The extension models, on the other hand, will be edited with behavi...

When using Doctrine::generateYamlFromDb(), can I specify a prefix to use?

When using Doctrine::generateYamlFromDb(), can I specify a prefix to use? For example, if the table name is "user", by default, the generated class name would be "User". Can I make sure the class name (and filename) is "PrefixUser"? ...

Trying to generate tables from Doctrine models and getting MySQL errors

Doctrine_Core::createTablesFromModels() is failing with the following error: Fatal error: Uncaught exception 'Doctrine_Connection_Mysql_Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'newmexicocreates.address_type' doesn't exist. Failing Query: "SELECT a.id AS a__id, a.title AS a__title FROM address_...

simulation modelling

hi, i have a big problem in a simulation model.entities arrrive before and wait until 6.00 am.And entities arrive after 6.00 am dont get any problem and walk inside. How to model this in Rockwell arena????Please help?? Regards, nilani. ...

Doctrine2: Best way to handle many-to-many with extra columns in reference table

I'm wondering what's the best, the cleanest and the most simply way to work with many-to-many relations in Doctrine2. Let's assume that we've got an album like Master of Puppets by Metallica with several tracks. But please note the fact that one track might appears in more that just one album like Battery by Metallica does - three albu...

Debug Mode vs. Release Mode - IsJITOptimizerDisabled Property

Hi everyone, I just had a look at previous questions on topic, but I've got some strange results. First of all, I followed and used the method that Scott Hanselman proposed in a old post in his blog: http://www.hanselman.com/blog/HowToProgrammaticallyDetectIfAnAssemblyIsCompiledInDebugOrReleaseMode.aspx Thus, Using the IsJITOptimizerD...

Spring: Proper way to make the Model available to the Controller?

Given the following controller, @Controller public class MyController { ... @RequestMapping("/data") public @RequestBody Data getData(@RequestParam String id) { return myCustomModel.queryForData(id); } } what is the proper way to configure it so that myCustomModel (something that is queried for Data) is ...

Update only part of a Model, validation problem?

Hi, I have a sign-up page where the user can input his FirstName, LastName, Email and Password, along with other fields. I have bound validation attributes to this Model (called "User" and created via LINQtoSQL) and all works well. Model code: [MetadataType(typeof(UserValidation))] public partial class User { } [Bind(Exclude = "User...

Weird crash when saving managedObjectContext

I am getting a weird crash when I try to save my model. This is my code: TJModel *model = [TJModel sharedTJModel]; NSFetchRequest *request = [[[NSFetchRequest alloc] init]autorelease]; [request setReturnsObjectsAsFaults:NO]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"TJVideoList"inManagedObjectContext:[model ...

Rails - Dynamically defining instance methods in a model

I'm not sure if this can even be achieved, but here goes... :) Lets assume two models, a Page model and a Field model. A Page has_many :fields and the Field model has two attributes: :name, :value What I want to achieve is in the Page model to dynamically define instance methods for each Field#name returning the Field#value. So if my ...

link to a controller function from the view

I have a function to take ownership of a job which updates the database to update the username in a table row. I want to link to this function from the view and then redirect to the appropriate page. How do you link to a controller function or a model function from the view? from the index i want to have another link beside show, edit...

Alternatives to this development pattern

Usually I start with pure model objects, usually in a tree structure. Depending upon the application, I will end up adding functionality to the model heirarchy, such as attaching UI controls and other data depending upon the application. Usually I'll do this by walking through the heirarchy and placing additional functionality on the ...

Rails Paperclip plugin stopped working?

Hi Everyone, I am using the Paperclip plugin to manage file uploads to my application. For some reason in the last day or so the plugin/model has stopped working and now returns the following error message: Paperclip::PaperclipError in DeliversController#create Asset model missing required attr_accessor for 'data_file_name' As far ...

ASP.NET MVC2 View Model for multiple view forms and data

Hi, one thing that has been puzzling me since learning MVC2 is the following case scenario: I have a view which contains two latest news lists, a login form and a signup form. Every example I found on Views and View Models so far has a one-to-one example such as a simple login form etc. But how do I create a model that provides the pr...

Rails find conditions... where attribute is not a database column

I think it's safe to say everyone loves doing something like this in Rails: Product.find(:all, :conditions => {:featured => true}) This will return all products where the attribute "featured" (which is a database column) is true. But let's say I have a method on Product like this: def display_ready? (self.photos.length > 0) && (...

Disable Model Validation in Asp.Net MVC

Hello, How do I disable Model validation for a single Action in a Controller ? Or can I do it per model by registering the model type at startup somewhere ? I want the ModelBinder to bind to the model, but afterwards it should not perform the model validation. The reason why i dont want validation to happen is because i am trying to m...

How can I add create/edit models feature on the model index page?

Ok, I have a model that is very simple: ServiceType(id: integer, title: string, duration: integer, created_at: datetime, updated_at: datetime) Because its so simple, It's ridiculous that I should have a separate page for creating and updating those types of records. What I would like to do is have a form on my index page which I can u...

Kohana model for data spread across multiple tables

I am putting together a DB driven website with kohana and I need to be able to track revisions. So I have the data behind the individual pages in two tables. The first is the generic entity table that I use for keeping track of all the sites content. It contains basic information: resource uid, uri alias, creating user, creation date,...

Is there a library of predefined models for SQLAlchemy?

I am seeking for a library of predefined models for SQLAlchemy. I think of something like you have in LDAP where you can just use an existing schema like inetOrgPerson, ipHost, ... and don't have to bother creating the structure. ...