Top "Models" questions

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

Class 'App\Http\Controllers\DB' not found and I also cannot use a new Model

I have very basic problem. In L4 thes below methods worked out of the box, so now I am lost. …

php laravel namespaces models laravel-5
How can I get the username of the logged-in user in Django?

How can I get information about the logged-in user in a Django application? For example: I need to know the …

python django django-templates django-views models
Django: Calling .update() on a single model instance retrieved by .get()?

I have a function which currently calls Models.object.get(), which returns either 0 or 1 model objects. If it returns 0, I …

python django models
Reusing a Model Built in R

When building a model in R, how do you save the model specifications such that you can reuse it on …

r models
Create if doesn't exist

I have a Django application that reads data from a web API and puts it in a database. Is there …

django models
Using datetime to compare with dates in Django

I have a question in Django on how you can compare dates to solve some solutions. For example I have …

django datetime views models datefield
AttributeError: 'ManyRelatedManager' object has no attribute 'add'? I do like in django website but got this error

for item in data: category_id = item['category_id'] del item['category_id'] category = Category.objects.get(pk=category_id) …

django many-to-many models
How can I fill up form with model object data?

I want to fill up form with data from model instance. But my form has less fields than model. If …

django forms models
Create Ruby on Rails views (only) after controllers and models are already created

I've obtained a project that have controllers (minimal code only) and models, but the views are missing. Is there a …

ruby-on-rails views models scaffold
Rails 4: organize rails models in sub path without namespacing models?

Would it be possible to have something like this? app/models/ app/models/users/user.rb app/models/users/education.…

ruby-on-rails namespaces ruby-on-rails-4 models subdirectory