Questions tagged [model]

Part of the MVC pattern, the Model manages the behaviour and data of the application.

The MVC (Model, View, Controller) pattern separates objects into one of three categories — models for maintaining data, views for displaying all or a portion of the data, and controllers for handling events that affect the model or view(s).

Frameworks such as Laravel, Rails, Django and ASP.NET MVC apply this pattern in the web development domain.

18996 questions
4
votes
1 answer

iOS MVC: where does the model fit-in to a CoreData application?

I've just gotten into making applications with CoreData, but I'm familiar with MVC concepts because I used to do a lot of work in web development using (and developing) MVC frameworks. From what I gather, CoreData automatically generates classes…
Logan Serman
  • 29,447
  • 27
  • 102
  • 141
4
votes
4 answers

How do I setup model associations in an RSpec test?

I've pastied the specs I've written for the posts/show.html.erb view in an application I'm writing as a means to learn RSpec. I am still learning about mocks and stubbing. This question is specific to the "should list all related comments" spec. …
Eric M.
  • 5,399
  • 6
  • 41
  • 67
4
votes
1 answer

zend select query inside joinleft

How to write SELECT query inside JOIN LEFT in a Zend model? for eg how to convert the following mysql query to zend model query LEFT JOIN (SELECT count(*) as game_count,topic_id,time as g_time from games_list WHERE type < 3 GROUP BY…
Harish Ambady
  • 12,525
  • 4
  • 29
  • 54
4
votes
1 answer

MVC 3, View Model for user registration process. Password validation not working properly

I am trying to create a user registration page using MVC 3, so that I can better understand the process of how it works, what's going on behind the scenes etc. I am running into some issues when trying to use [Compare] to check to see that the user…
sec_goat
  • 1,272
  • 1
  • 12
  • 20
4
votes
1 answer

Is properly tracking source model row movement a part of QSortFilterProxyModel's contract?

Suppose I have a source model, within which the row movements are decorated with beginMoveRows() endMoveRows() (and hence emit layoutChanged()). Then, there's a QSortFilterProxyModel instance set up to filter rows of the source model. As I get it…
mlvljr
  • 4,066
  • 8
  • 44
  • 61
4
votes
2 answers

MVC EF Code First one to one relationship error

I want to have a list of stands (at a trade show) and a list of exhibitors. The list of stands is separate to the list of exhibitors - however, once registered, I want the exhibitor to be able to book a stand. When they select/book a stand - I would…
Mark
  • 7,778
  • 24
  • 89
  • 147
4
votes
5 answers

Dynamically call a static variable (array)

Here's my question for today. I'm building (for fun) a simple templating engine. The basic idea is that I have a tag like this {blog:content} and I break it in a method and a action. The problem is when I want to call a static variable dynamically,…
BebliucGeorge
  • 751
  • 2
  • 8
  • 15
4
votes
1 answer

mapping between domain model and view model with IEnumerable

so my domain model has a property named Children which returns all menus with the ID of the current object. I want to create a view model and in controller map the values between them. So Children property is IEnumerable and menu.Children…
bobek
  • 8,003
  • 8
  • 39
  • 75
4
votes
1 answer

Codeigniter: foreach method or result array?? [Models +View]

I am currently following tutorials on viewing data from the database using the Framework Codeigniter. There are various ways in which I've learnt. Is there is a more realiable way- either displaying as an array or using 'foreach' in the view file?…
Shimsham84
  • 227
  • 2
  • 12
  • 29
4
votes
1 answer

Survey Weighted Random Effects Logit Model in R

I am trying to predict a binary outcome with a model that includes a random effect using survey data. I've included a description of the sampling design below, so feel free to comment on my survey weighting approach. My primary question is how to…
mike
  • 22,931
  • 31
  • 77
  • 100
4
votes
3 answers

Zend Framework Model

is it posible to have a true Model Layer in PHP like in Ruby on Rails? With Zend Framework you can create a Model but this is a class. As I know you have to write all the logic by myself. Solutions?
xpepermint
  • 35,055
  • 30
  • 109
  • 163
4
votes
1 answer

How to update balance in a accounting app with django ?

I'm learning Django, trying to do an accounting app for keeping track of my expenses, etc.. I created the database with two models, one for accounts and one for operations. But i have no idea how to keep my balance updated with each operation. I was…
Serphone
  • 107
  • 1
  • 1
  • 6
4
votes
2 answers

How can i use multiple controller with one model?

I have a model named "Post" with following attributes: class Post < ActiveRecord::Base attr_accessible :content, :published_at, :status, :title, :type, :user_id has_many :entity_categories has_many :entity_pages end A post have type field…
S.M.Mousavi
  • 5,013
  • 7
  • 44
  • 59
4
votes
1 answer

Rotate 3d model XAML c#

I have written a program, which import a 3d model in XAML format:
bbklol
  • 45
  • 5
4
votes
2 answers

rails reference model from variable name

i have some code that uses a string to determine dynamically what model class to use and for what field to find_by() on. however, i'm having a hard time with how to use these variables to get the model instance. specifically, i have class Item …
yee379
  • 6,498
  • 10
  • 56
  • 101
1 2 3
99
100