Hello, people!
I have this piece of code:
class MY_Language extends CI_Language {
function MY_Language()
{
parent::CI_Language();
$CI =& get_instance();
$CI->load->model('language_model');
$languages = $this->language_model->get_languages();
print_r($languages);
}
}
But I keep...
class Map(Group):
members = models.ManyToManyField(User, related_name='maps', verbose_name=_('members'))
class Position(models.Model):
map = models.ForeignKey(Map)
LatLng = models.CharField(max_length=2000)
and the Group is :
class Group(models.Model):
"""
a group is a group of users with a common interest
""...
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?
...
I have a Book model in my Rails application, with various properties (aka columns in the book db table). One of these properties is "ranking".
Recently, may app has started to throw NoMethodError: undefined method 'include?' for nil:NilClass for the following code:
def some_method(book, another_arg)
return book.ranking unless book.ra...
I am building a MVVM application. The model / entity (I am using NHibernate) is already done, and I am thinking of using AutoMapper to map between the ViewModel and Model.
However this clause scares the jebus out of me: (from http://www.lostechies.com/blogs/jimmy_bogard/archive/2009/01/22/automapper-the-object-object-mapper.aspx)
Bl...
I can't access my model's attributes in the after_create callback... seems like I should be able to right?
controller:
@dog = Dog.new(:color => 'brown', :gender => 'male')
@dog.user_id = current_user.id
@dog.save
model:
class Dog < ActiveRecord::Base
def after_create
logger.debug "[DOG CREATED] color:#{color} gender:#{gender} ...
I'm building a small financial system. Because of double-entry accounting, transactions always come in batches of two or more, so I've got a batch table and a transaction table. (The transaction table has batch_id, account_id, and amount fields, and shared data like date and description are relegated to the batch table).
I've been usi...
I'm creating a little management tool for the browser game travian. So I select all the villages from the database and I want to display some content that's unique to each of the villages. But in order to query for those unique details I need to pass the id of the village. How should I do this?
this is my code (controller):
function me...
I dont see any direct mention on using multiple slugs (or any behavior for that matter) for single model. Is there a way to use the sluggable behavior to generate two separate slugs for a model?
For example i need to generate two slugs for every record a product_id consisting of a slugified company name and sku and a distributor_id con...
Hi, I'm having hard time with tables and column widths.
Update: I'm using XHTML Strict 1.0.
The page is: http://www.pro-turk.net/try
The first problem I have is, I have a column with a fixed width of 100px and 4px padding, but it disobeys my padding depending on the value. The column width (as the distance between two borders accordin...
Hi there,
I want to do a model class which associates to itself on Rails. Basically, a user has friends, which are also users. I typed the following inside a User model class:
has_many :friends,
:class_name => "User",
:foreign_key => :user_id,
:finder_sql => %{SELECT users.*
FROM
users INNER JOIN friends
...
I have a function in my Comic Model as such:
<?php
class Comic extends AppModel
{
var $name = "Comic";
// Methods for retriving information.
function testFunc(){
$mr = $this->find('all');
return $mr;
}
}
?>
And I am calling it in my controller as such:
<?php
class ComicController extends AppController...
I need to keep track of number of "hits" on a particular item in a DB.
The thing is that the "hits" should stay unique with a user ID, so if a user hits the item 3 times, it should still count for a hit of 1.
Also, I need to display the total number of hits for a particular item.
Is there a better way than to store each hits for each i...
I have a Zend_Framework application, which has a whole bunch of model classes.
I need these model classes to be able to access the application's database (naturally).
Currently I've put this in my index.php:
Zend_Registry::set('db',
$application->bootstrap()->getBootstrap()
->getPluginResource('db')->getDbAdapter());
...
Note: This is a "railsier" (and more succinct) version of this question, which was getting a little long.
I'm getting Rails behavior on a production server that I can't replicate on the development server. The codebases are identical save for credentials and caching settings, and both are powered by Oracle 10g databases with identical s...
I have two Models, Modela and Modelb.
Modela can only own one Modelb, but Modelb can be a part of many Modela's.
What I have right now is
class Modela < ActiveRecord::Base
has_one :modelb
end
class Modelb < ActiveRecord::Base
belongs_to :modela, :foreign_key => "modela_id" #might not make sense?
end
Not too sure about the whole...
I have several entities which respresent different types of users who need to be able to log in to a particular system. Additionally, they have different types of information associated with them.
For example: a "general user", which has an e-mail address and "admin user", which has a workstation number (note that this a hypothetical ca...
There is an class android.os.Build that got static variables cointaining device info,
but when i try to access it I allways get a runtime exception.
E.x on how I try to access it:
String model = Build.MODEL;
I always get an Exception like this:
04-14 14:57:45.266: ERROR/AndroidRuntime(770): java.lang.VerifyError: com.mypackage.Main
...
In my app, I have a User model and a Project model. A user has_many assignments and each project belongs_to a user. But along with each project having an owner, the user who created it, I would like the owner be able to share it with others (so that the project gets shown on the other users' account along with their own). I imagine havin...
Hi all,
iam using sharepoint object model to access the sharepoint list items.when iam login to the site with fullcontrol permission it is working fine.but when iam login with read permission(user) it is not working.
please tell me can we access the list items with read permission user through object model.
...