I've been reading up on memory models in an assembly book I picked up and I have a question or two. Let's say that the address bus has 32 lines, the data bus has 32 lines and the CPU is 32-bit (for simplicity). Now if the CPU makes a read request and sends the 32bit address, but only needs 8 bits, all 32 bits come back anyway? Also, t...
Hi,
excuse me in advance if this is not the right title for the problem but here it is:
You have application that works with pre defined model. What happens if you want to
use this application one more time in your project but pointing to different model (same structure but differen name).
For example - you have a "News" application ...
Is there a way to restrict what I see when I select the View Data Class drop down, to just the models in my Application? It seems that if I have any references in my app, that drop down gets really noisy.
...
This is a general model binding question that applies to MVC 1 & 2. I'm wondering if MVC2 would be better for this, but here's my question:
I have a fairly complex model:
public interface IEvent
public int Id
public string Title
public List<EventContact> Contacts
public List<EventDatesLocations> DatesLocations
public class Ev...
We are creating a rails application for an already existing database. We need to map some database tables together.
Suppose we have three tables: event, event_groups and event_to_groups.
There are some events, there are some groups, and each event can be assigned to one or more groups.
How do I model this relation in rails?
eg:
Ex...
Hello !
What i want is simple :
models :
class userLastTrophy(models.Model):
user = models.ForeignKey(userInfo)
platinum = models.IntegerField()
gold = models.IntegerField()
silver = models.IntegerField()
bronze = models.IntegerField()
level = models.IntegerField()
rank = models.IntegerField()
pe...
I'm writing an app where a user can both create their own pages for people to post on, and follow posts on pages that users have created. Here is what my model relationships look like at the moment...
class User < ActiveRecord::Base
has_many :pages
has_many :posts
has_many :followings
has_many :pages, :through => :followings, :source ...
Given a reference app ( called guide), how can I create additional apps that will reuse the same model/admin/views than guide - the motivation behind is to be able to individually control each subapp.
guide
guideApp1
exact same models/admin/views than guide
guideApp2
exact same models/admin/views than guide
in the Admin site, I...
We are using MVC in our application; the Views we are using get created by other team. The problem is that they use their own names for input HTML controls which are different from the input text-box names in the Model. I have a strong feeling that this issue had already been addressed somewhere but cannot find any references. Could anyb...
UPDATE The issue is solved, all the code you can see works.
Hello!
I have a ForeignKey relationship between TextPage and Paragraph and my goal is to make front-end TextPage creating/editing form as if it was in ModelAdmin with 'inlines': several fields for the TextPage and then a couple of Paragraph instances stacked inline. The proble...
django how get session in models or how get session out views
...
I currently have a form that I am building that needs to support two different versions. Each version might use a different subset of form fields. I have to do this to support two different clients, but I don't want to have entirely different controller actions for both.
So, I am trying to come up with a way to use a strongly typed mo...
Hello everybody
I am building a news app for my website. I want to use a sort of tag system. Each news article can have different and multiple tags. All tags are saved in a tag model, and i want to connect the tags to the newsarticle. Now is this possible with: tags = models.ForeignKey( TagsModel ) for one tag, but how i can do this wit...
Can anyone help me listing the Hierarchical models of software quality? Please can anyone say me
Is it just McCall and Bohem model or many other hierarchical models exists?
...
Hy,
my controller example:
class FriendsController < ApplicationController
before_filter :authorize, :except => [:friends]
##############
##############
## REQUESTS ##
##############
##############
##################
# GET MY FRIENDS #
##################
# Get my friends.
def friends
@frie...
I run script/generate model query
edit query.rb in models..
class Query < ActiveRecord::Base #I even tried Migrations instead of Base
def sef.up
create table :queries do|t|
t.string :name
end
end
def self.down
drop_table :queries
end
end
,run rake db:migrate.
and what I see in db is this:
mysql> desc quer...
Hi.
I get a model object, change an attribute, save it and it still has the old attribute:
>>> g = SiteProfile.objects.get(pk=3)
>>> g.renew_date
datetime.date(2010, 4, 11)
>>> g.renew_date = date.today()+timedelta(days=365)
>>> g.renew_date
datetime.date(2011, 4, 11)
>>> g.save()
>>> g.renew_date
datetime.datetime(2010, 4, 11, 16, 57,...
I have a model
class Article(models.Model):
.
.
language = models.ForeignKey(Language, help_text="Select the article's language")
parent_article = models.ForeignKey('self', null=True, blank=True)
If an article is an original article then 'parent_article=None'. If an article is a translation then 'parent_article' <> Non...
Hi.
Would it be possible to serialize a model object into a query string?
I've no idea if this is even possible, but if not, what is the best way to do this?
<% Html.RenderAction("Grid", "Grid", new { gridModel= ViewData["model"]}); %>
The Model is containing ca 20 properties, and creating the querystring with them in individually wo...
I have two models Library and Book. In my Library model, I have an array - book_ids. The primary key of Book model is ID.
How do I create a has_many :books relation in my library model?
This is a legacy database we are using with rails.
Thanks.
...