model

Rails app, and need to add tags to a model

I have this quiz rails app linked to an IRC bot who asks questions (yes, on IRC), where I have this Question model which contains, well, questions, answers, hints, and a few more things. I started with Quiz model (like, say, the special Halloween or Christmas quiz) with a quiz_id in the questions table, then, I told myself, that it wou...

Non persistent data in a Rails app

Hi, I'm somewhat new to rails so please be gentle. I'm working on an "analytics" page for a rails app. The analytics page does not persist any data of its own (it's very primitive at this point) but does utilize metrics that I'm grabbing from the DB (via the aggregate expressions built into ActiveRecord). Aside from gathering and prese...

How to Create a Managed Path through SharePoint Object Model

This is a question for a WSS/SharePoint guru. Consider this scenario: I have an ASP.Net web service which links our corporate CRM system and WSS-based intranet together. What I am trying to do is provision a new WSS site collection whenever a new client is added to the CRM system. In order to make this work, I need to programmatically ...

Deleting erroneous ReferenceProperty properties in AppEngine

Most of the time, the errors you get from your model properties will happen when you're saving data. For instance, if you try saving a string as an IntegerProperty, that will result in an error. The one exception (no pun intended) is ReferenceProperty. If you have lots of references and you're not completely careful about leaving in bad...

Model Warnings in ASP.NET MVC

I'm currently using the ModelStateDictionary in asp.net mvc to hold validation errors and pass then back to the user. Being able to check if the whole model is valid with ModelState.IsValid is particularly. However, a current application I'm working on has a need to be able to report warnings. These aren't as critical so the form content...

Image thumbnail creation in the Model?

I am wondering if including image thumbnail information in the model makes sense. Like specifying what sizes of thumbnails you would like to be created. Thumbnail directory. Etc. Also when working with thumbnails and a database, Is it advisable to store all created thumbnails as new records in the database. Say you have Image record wou...

Scaling a rich domain model

Domain Driven Design encourages you to use a rich domain model. This means all the domain logic is located in the domain model, and that the domain model is supreme. Persistence becomes an external concern, as the domain model itself ideally knows nothing of persistence (e.g. the database). I've been using this in practice on a medium-s...

How do I save a NamedTemporaryFile into a model FileField in Django?

I created a NamedTemporaryFile, added some content in it and now I want to save it into a model FileField. The problem is that I get a SuspiciousOperation because the tmp directory is not within the FileSystemStorage directory. What's the proper way to do this? ...

authentication/ authorization schema

is there any best practice data model for authentication/ authorization schema ...

Models, Factories and Repositories

Hi, I'm porting our old Active-Record based API over to a new structure to make unit testing easier etc. We are using the repository pattern for our data access and StructureMap for dependency injection. I'm struggling a little now with how to structure everything. Using our 'Product' class as an example, we previously had our model, r...

SimpleModel Resizing the Container

Dear All, I have Used SImple Model, Now Problem Is The Resizing of Modal, I have Confirm Dialog One is Basically Small size after pressing Yes , The Second One is my.php contains large Data,I am Using the concept of Appending Already existing model ,Will any body tell how to Resize the Content and My JS Snippet Has ...

How do you negotiate a domain model with your domain experts?

Suppose you're working with a customer's domain experts. You realize (or at least have a reasonable belief) that your model of their problem is clearer than theirs. How do you convince them that they should go your way. In my case, it is fairly clear what the main thrust of the requirements are (e.g. a trading system for a product). Bas...

How to organize Rails models that are too fat?

It is good practice to shift logic from the controller into the model. But in any complex system, this invariably leads to a very large file even if a majority of the methods are one liners as per the Rails Way. I've resorted to splitting up models into other modules and including them in the original model, for example, model_flags, mo...

Rails form validation conditional bypass

I have a rails model that validates uniqueness of 2 form values. If these 2 values aren't unique the validation errors are shows and the "submit" button is changed to "resubmit". I want to allow a user to click the "resubmit" button and bypass the model validation. I want to do something like this from the rails validation documentat...

MVC Model: submitting multiple objects to the View

im not sure if there is a difference in these two methods. If so, which would be considered the better practice when submitting more than one object to the View. 1- Having the controller make separate calls to the datalayer for each object model and then wrapping the objects in a model to send to view. 2- Defining a "presentation" mode...

MVC in .NET: How to not duplicate classes?

I have a Person class in the Model and want to assign 15 of its attributes to labels in the View. The View shouldn't access the Model. That means the Controller will handle creating the Person. How does the View get these Person attributes from the Controller? If the Controller contains a member of Type Person, the View can do someth...

Is this part of MVC in .NET?

I have a .NET MVC winform app. I've created an AppDelegate class that handles application startup and shutdown...for now (it might do more later). Winform apps have a Program.cs file that does some app initialization, starts the message pump and creates the first form. In my app, the first form is AppDelegate, which isn't really a fo...

How to design a User Object Model using MS Roles & Membership

I would like to build a ‘User’ Object model for a somewhat typical web application…however I cannot decide how best to design the object model & role system. Basically I plan to have about 4 user types…which will correspond to user ‘roles’ in the membership provider. These types will be: • Worker • Employer • Guest • Admin Th...

Does this Entity Repository Service example fit into Domain-Driven Design?

I would like to know if you find the following pattern meaningful in domain driven design. The domain layer consists of model and repository. The application layer consists of services that handles queries from the user interface, or from controllers in the Model-View-Controller pattern. Details of the structure: // Assembly Model: p...

What's a good way to store model data in a jQuery app?

I'm working on a web app which is heavy on the client side, which is a first for me. I'm also using jQuery for the first time. I need to have my client-side code keep track of model data which it fetches via Ajax calls. What's a good way to store this data? Does jQuery provide a good solution, or is there a good generic Javascript so...