Questions tagged [model]

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

0
votes
0answers
3 views

Type: Error Message: Call to undefined method Main_model

I am not able to figure it out the error can any one help me .. Below is the code. main_model.php <?php class Main_model extends CI_Model { // function fetch_data($selecteddate){ // //$...
0
votes
2answers
34 views

Laravel Role HasMany relationship

I have a User Model and a Role Model which are in many-to-many relation. I have two roles: admin and manager. I also have an Order Model. Managers need to have many orders. Where do I state such ...
0
votes
1answer
14 views

Database Design Model Entity Relationship Diagram n-entities relationship with 1:m entity - best practise

I have 3 entities (Clients, Reseller, Controlstation) and each of them can have multiple rows of another entity (Contacts). I've made an Entity Relationship Diagram with crow-foot notation to make ...
0
votes
2answers
33 views

Using a model function in Laravel [on hold]

Do you think we can write our method in model and just call them in controller instead of writing every method for every controller. I wonder how can I write a method like create or show in model ...
0
votes
1answer
35 views

How to ignore a column in SQL updates

I have a program that looks through a User model and adds values to a prepared update statement if they are not null as follows PreparedStatement pst = conn.prepareStatement("UPDATE users SET ...
0
votes
2answers
24 views

Minimum number validator is not working in Yii2 model

[['price'], 'integer', 'min' => 0, 'tooSmall' => 'Price cannot be less than 0'], I have above rule in my model file. But while validating the model, return is true while passed NULL as price. ...
0
votes
0answers
6 views

How to get base url in ZF2 Model?

I moved my controller functions to model and converted them to a static function. I was getting base URL in the controller like that: $this->getRequest()->getBaseUrl() Now I tried this in ...
0
votes
0answers
22 views

Loading ALL textures from a URL in ThreeJS

it's my first time with threeJS and I am working on a texture/model viewer. All textures and models are lying on a VPS. The html is served with Express. This partially works: var renderItem = { ...
0
votes
1answer
19 views

What are the column definitions for H2O's gains/lift table?

H2O's documentation doesn't provide clear definitions for each column in the gains/lift table output. I'm not sure how the capture rate is being calculated, and there is a score column that is not ...
0
votes
0answers
27 views

Partial View Model for different entity types

Let's say I have these 2 models with a small difference in Data Validation Attributes : public Dog { int Id{get;set;} [StringLength(5)] [Remote("IsDogExists", "ControllerName", HttpMethod ...
0
votes
0answers
22 views

Split Model data into Two models which is received via parameter [on hold]

I am receiving some values in one of my function mentioned below. I am receiving it in form of list of a model. I have to save that data into two different models. So i thought to split the data in ...
0
votes
2answers
14 views

Different Model callbacks depending on whether for API or in-app

I want to add a mobile app to my web app that has some differences in the User model. Specifically when a User signs up in the web app, the model generates an activation digest which is emailed to ...
2
votes
2answers
28 views

Django | How to make a reverse Relationship with two models

i want to make a ticket system. I have the main model (TicketSystem) and a model with the messages from the users (TicketSystem_Messages). In the model "TicketSystem_Messages" is the ForeignKey to ...
0
votes
1answer
30 views

Save search query result into a model with django

I have the following code in my view. I want to save the query result (if it's true) into another model. How to achieve this? def scan(request): print(request.session) if request.method == '...
0
votes
0answers
22 views

MVC : Clear model value after Ajax.Beginform has been submitted

I have this model : public class VehiculeModalViewModel { public VehiculeModalViewModel() { Title = "Nouveau véhicule"; TextToDisplay = "Nom du nouveau véhicule :"; } [...
-1
votes
0answers
16 views

Bad detection from a pre-trainded model

For detecting a particular machine for my assignment I used the pre-trained model : faster_rcnn_inception_v2_coco_2018_01_28 . After finishing training I tested it. The model detects and labels the ...
1
vote
1answer
30 views

How to add an attribute with array of integers data type in sails.js model?

I'm using sails with postgresql and I have a user with an array of group ids. I want to save the group id in the user table. my user model is like: module.exports = { attributes: { ...
0
votes
0answers
59 views

Odoo 10: Cant parse date field using Element tree in python

I defined a field in models.py : activation_date = fields.Char(string='Activation Date') In this field I want to add a value which is coming from a response xml of SOAP api call.I am using Element ...
1
vote
3answers
27 views

Database modeling: Inheritance

I cannot quite figure out how to model my database with this Problem: A journey has one driver. A journey has multiple passengers. Both driver and passengers are users. A user obviously ...
0
votes
1answer
11 views

How can I convert TRT optimized model to saved model?

I would like to convert a TRT optimized frozen model to saved model for tensorflow serving. Are there any suggestions or sources to share? Or are there any other ways to deploy a TRT optimized model ...
0
votes
1answer
19 views

Filtering Images with Button Clicks AngularJS

I'm needing to filter images based on category in the model. I've created buttons for the category. E.g. if user presses Lake Pics button, would like it to filter all of the images with the category ...
0
votes
0answers
14 views

Laravel 5.4 won't sync models

I'm trying to get two models that have a defined relationship to sync, but when attempting this, one side of the equation is blank. One model has a primary key that is not of the usual convention, ...
1
vote
0answers
15 views

Trying to return most popular blog post using acts_as_votable

So here's my model: home_blog.rb def self.highest_voted self.order("cached_votes_score DESC") end schema.rb create_table "home_blogs", force: :cascade do |t| t.string "name" t.text ...
0
votes
1answer
28 views

Spring Boot And Thymeleaf remain on the same page on post request is made

I've created an web app that searches for online car ads and populates the page with a few tables after a post request.It looks like this: After Search: Every table element has a save button which ...
-1
votes
0answers
32 views

How to check model has data or not in swift?

I have created a user model like below:- import RealmSwift class UserData: Object { var email = "" var first_name = "" func initUserWithInfo(userInfo: [String : AnyObject]) { if ...
-6
votes
1answer
65 views

How to create a model that implemest parcelable

My response is like below "data":[ { "title": "hbdv", "description" : [ "a", "b", "c" ] }, { "title": "bdvv", "description": [ ...
0
votes
1answer
18 views

How to build an array of dictionaries depending on the values of a certain model

I have a type alias of [String:Any] public typealias Parameters = [String:Any] And i have a computed property that will build these parameters from the model values. var parameters: Parameters { ...
0
votes
1answer
35 views

define table name in laravel model

when I define table name in laravel model like class Test extends Model { use SoftDeletes; protected $table="en_test"; and write in my code DB::enableQueryLog(); Test::get(); ...
1
vote
1answer
32 views

Laravel 5.7 Many To Many Relation Problem With Pagination

i have some problem with this relation in laravel. this is my mysql tables and this is my controller code: namespace App\Http\Controllers\Dynamic; use Illuminate\Http\Request; use App\Http\...
-1
votes
1answer
41 views

How to use generic types in mvc model view

I want to create a partial view which will be used several times with differents entities. It seems that the way to do that is to implement interfaces and use generic types. But after a lot of search ...
3
votes
1answer
70 views

Django ImageField will not display on webpage

I am using an imageField in my Django model and the photo is not being recognized when I try to display it in the html. Here is my models.py from django.db import models class LatestRelease(models....
1
vote
1answer
32 views

In Laravel::Eloquent tables, how can I set the model to read from a view, but save to a table?

Given: I have a MySQL table called Letter. I have a string column called Letter.RecipientCode that identifies who the letter is going to. The code is a string of numbers identifying the recipient's ...
0
votes
2answers
36 views

Edit data from a form - Django

I'm looking for help on a very basic problem I know, but I can't get it fixed and I don't know where I did something wrong (as usual) So basically I have created a model form "formulaire_equipement" ...
0
votes
0answers
13 views

Data modeling in Salesforce for hiring houses

I want make a data model for the following: Clients can make a reservation on a property/house where they would like to go on a vacation. Properties/houses can be added to the database by a someone ...
-1
votes
1answer
45 views

Consistently using associated model subclasses

I have a situation where I have basic models that I want to add business logic to. For example, I might have something like this. class List < ApplicationRecord has_many :subscriptions ...
0
votes
0answers
36 views

Passing Request data into a model observer class

I have the following Model Observer: class UserObserver { /** * @var \Illuminate\Http\Request */ protected $request; /** * UserObserver constructor. * * @param \...
1
vote
1answer
35 views

How to manage productsController and ImagesController from the same form?

I have seperated databases; products and images. and they has own controller. Also I created relations between them. Now I dont know how to use different Controller for the same form. I want to store ...
0
votes
0answers
10 views

Print Probability with Wide Model Python

#Structure of the code for wide model #!/usr/bin/env python # -*- coding: utf-8-*- import pandas as pd import tensorflow as tf import tempfile COLUMNS=["DA","PD","LO","MN1","MN2","...
0
votes
0answers
9 views

What model/test should I run for multiple points in time with multiple control variables SPSS/R

I am having a hard time deciding on the model I should run to get the results I want from my data. I have a total of 5 groups which are tested at the beginning of the experiment and the end of the ...
2
votes
2answers
37 views

Sort the parent model based on the child model / relationship

I have a model called appointments, each appointment has an option_id that is linked through a one to one relationship and the option_id can also be null. The option model has a property ...
1
vote
3answers
44 views

How to count in laravel from different table

Hei I'm making data table to show how many comment that on my post from user that login and making that post but I got some bug it retrieve only 1 but actually I got like 26 comment, I dont know why. ...
1
vote
2answers
27 views

CodeIgniter : Undefined index in model variable

I have the below code in of of my models. Im loading the offer details page and it gave me the error Severity: Notice Message: Undefined index: viewc Filename: statistics/Statistic_model.php Line ...
-2
votes
0answers
29 views

Model fitting with excel [closed]

I am beginner with R and find some issues : I have a curve on which I've drawn a tendency curve, bringing to an equation. I don't know if these equations are fitting the initial curve and I would ...
0
votes
1answer
61 views

Ruby on Rails - accessing nested attributes of current user

i am trying to access some nested attributes in a rails partial; let me explain my issue: i wrote a simple messaging service according to the tutorial of dana mulder i mentioned in another question ...
0
votes
1answer
31 views

C# ASP.NET MVC - Unable to get the properties/data of POST data I received from the frontend

From the front end I am sending a POST request with the following data that I cannot change the structure of: I am trying to get the "filter" data. I created a Model for the following data as ...
0
votes
1answer
31 views

Passing model data onto another view [duplicate]

So I've tried to follow multiple threads on here to do what I am to, and so far it all seems to have something to do with a singleton which I think is a bit over-the-top solution for my issue. I'm ...
1
vote
3answers
21 views

How to get the name and url of an uploaded file when using models.FileField

I am using the following files: settings.py: MEDIA_URL = '/data/' MEDIA_ROOT = os.path.join(BASE_DIR, 'data') urls.py: urlpatterns = [ path("photo/upload", views.upload_pic, name="uploadpic ") ...
0
votes
0answers
12 views

Model is retraining itself during inference of the nmt model

I have modified Google's official nmt notebook into 3 files as data_prep.py, train_model.py and inference.py. When I run the inference.py script, the model is retraining itself from scratch instead of ...
0
votes
0answers
13 views

How to cache external meta db table in django?

I am trying to cache external db inside my django program. Here is the sample code I have: class Summary(models.Model): summary_id = models.IntegerField(primary_key=True) name = models....
2
votes
1answer
26 views

Working with QueryObjects and modules in Rails

Just starting working with Rails QueryObjects. I would like to group them in modules and submodules, but it doesn't work. With a simple QueryObject test, it works: class CountriesQuery def ...