Newest 'model' Questions - Stack Overflow

Questions tagged [model]

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

0
votes
0answers
12 views

How to Extract Rows Specific info from Sklearn Logistic Predictions

I have a logistic regression that predicts which customers are going to churn. I can't seem to find code anywhere that extracts the Accounts that are predicted to churn. Account Name is an string ...
0
votes
1answer
12 views

In Django model, how to save DateTime for two different timezones at the same time when saving one field with auto_now_add = True option?

I am a Django model which has an auto current time saving DateTime field. I want to add another DateTime field for another timezone which time difference with the previous DateTime field is exact time ...
0
votes
0answers
22 views

Django: Check multiple conditions before save model

This is my models.py: class Department(models.Model): name = models.CharField(max_length=20, blank=False, null=False, verbose_name='Department') def __str__(self): return '{}'.format(self.name) ...
0
votes
0answers
9 views

In IBM loopback 4, can I use getter and setter for a model property?

When I generate a model with loopback cli (lb4 model) I get a model with some properties. I am specifically trying to make a setter to hash a user entity password. Initially, I get the following code ...
0
votes
1answer
33 views

How to get MVC model property to return a Date instead of DateTime?

I have a model for my database that has a DateTime property. However, this property is really a Date. The extra time component is causing issues when sorting/filtering on the client. Many tables/...
-1
votes
1answer
20 views

Pulling Live Data from Excel to Use in my Python Model

I'm currently working on creating a model that takes as inputs some market data every 30 min of various futures markets. My data provider has a real time data link available for excel so I've set up a ...
0
votes
0answers
7 views

MVC VB Change Controller database value before passed to view

So I have a table in the database using a edmx entity and pulling the values and need to mod one on the fly in the controller before being passed to the view. So this is what I got; Function ...
2
votes
1answer
35 views

Rails: How to implement login and authentication where i have five different user models in rails?

I'm fairly new to rails. I'm having problem on designing the model classes. So this app will be used by 5 different users(Students, Teachers, Head and Coordinator). They each are different users to ...
0
votes
0answers
9 views

state space models with regime switching in R

I'm trying to do some time series analysis with state space models in R. So far I used the packages dse and dlm. I was wondering if there is a package, which allows for regime switching state space ...
1
vote
0answers
13 views

Django inline model: can I apply a different css to the header?

Django 2.2 I have inline mode which works fine as described here. Both main model and inline model are using default Django templates, nothing is custom yet. I also have defined verbose_name_plural ...
0
votes
1answer
35 views

Model values not carrying into partial view from main view- C# MVC

I've been stumped for days. I have an index page that contains a renderpartial view. A viewmodel is passed to the index page from its controller, then passed from inside the index.cshtml to the ...
0
votes
0answers
14 views

Django: Creating an intermediate form with radio buttons that redirects the user

I have a Django project in which the user registers (this is the default user registration in use) and after registration I want them to be able to select an option - W or WP (radio buttons). ...
1
vote
3answers
40 views

what is the best way to save json data in swift model

I previously made a post about how to save json data in a model here . Good now I am developing a project on iOS with swift, and I face the following problem, it happens that sometimes the database ...
-1
votes
1answer
14 views

MVC Html.DisplayFor mulitple foreign keys use correct one

I have a table called tblSize with these values; ID (PK) SIZE 1 MM 2 INCH 3 FEET Then I have another table tblMember with these values; ID (PK) MEMBER SIZE MIN_SIZE_ID (FK) ...
0
votes
2answers
19 views

Model cannot be found in Phalcon controller

I'm new to Phalcon and trying to access a model in a controller but the error below is shown: Fatal error: Uncaught Error: Class 'settings\Settings' not found in C:\xampp\htdocs\icriticize\app\...
1
vote
1answer
21 views

Is it better to use ModelAndView or return a String as a view?

I'm building a Spring MVC application and just wondering what the convention is concerning modeling and view. Is it better to return a ModelAndView or just return a view name as a string? Example ...
0
votes
1answer
16 views

How to initialize umbraco MemberService in published model?

I am using Umbraco 7.6 and ModelsBuilder I am trying to extend my CustomMember model and add some custom properties. I want to get IMember as a property. For this I need to initialize MemberService ...
0
votes
0answers
23 views

error: Call to a member function query() on null

I am using classes and visibility in PHP to create a model view driver example. But I get an error in Query. Call to a member function query() on null <?php class personas_model{ ...
-2
votes
0answers
24 views

How do I make a Cube in Json rotate indefinitely?

Im working with a friend to create an "interactive" Texture pack for Minecraft, and some of the pieces of it are rendered 3D, and Im not entirely sure how to make an animated 3D Object. Basically I ...
0
votes
1answer
23 views

How can I send FormData using XmlHttpRequest and map to viewmodel properties

I'm trying to send some values in a FormData object using XmlHttpRequest to a Controller. The thing is when I do this locally (localhost) the data is mapped to the properties of the ViewModel ...
0
votes
1answer
41 views

Minimum Age Validation With dd/MM/yyyy Format Date In Client Side ModelValidation

Here is my client side validation (function ($) { // Here I will add code for client side validation for our custom validation (age range validation) $.validator.unobtrusive....
0
votes
1answer
18 views

How to sum up amount in django choices

I'm trying to find the total amount of material costs in columns given I have to select the amount with django choices. I have tried adding up using self.amount1+ self.amount2 to no avail ...
2
votes
1answer
46 views

Model isn't updated with setContextProperty

I'm very new to Qt and have issues passing my Model to my View. My view features a bunch of buttons and a Map with some markers whose latitudes/longitudes come from my Model. Clicking on buttons ...
0
votes
1answer
19 views

Creation of related Models on auth RegisterController in laravel

In my application, I have tables related to users and some of these tables require a row be inserted as soon as a User is registered. For example, I have the following models: UserProfile, ...
0
votes
0answers
21 views

“To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier.”

How to remove this message after click on model close button: "To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was ...
0
votes
2answers
30 views

how to update model after droping coulmn from sql database

I droped catalog_filename coulmn from database and I see this error : Schema specified is not valid. Errors: The relationship 'J_DBModel.FK__CATALOG_T__CATEG__41B8C09B' was not loaded because the ...
1
vote
1answer
44 views

Kotlin Data class v/s open class?

As I am converting my java project to kotlin project, I came to know about data classes in kotlin(replacement of Java model classes). Now I have a requirement for my kotlin data class to support ...
-1
votes
1answer
29 views

Best efficient way of converting JSON string to model object

I have various HttpClient calls which return back a json string. I am currently using the following code to convert the string to a custom 'object' model I have: public static async Task<List<...
0
votes
0answers
11 views

why it is saying model not found even if i have the same

odoo.tools.convert.ParseError: "Error while validating constraint Model not found: registration.form Error context: View Student Registration Form [view_id: 1143, xml_id: registration_form....
0
votes
1answer
31 views

How to implement an image in a JsonSerializable model class

I need to be able to retrieve and also to store an image using an API. For my model classes I'm using @JsonSerializable. What I'm struggling with is the data type to use for the image in my model. ...
1
vote
1answer
18 views

Create Dropdown With Values From Model in Django Form

I am attempting to create a dropdown field which populates with values from a model (Customers) and display it to the user. Below is what I am attempting - not exactly sure why, but the dropdown ...
0
votes
1answer
20 views

Django - Handle Image and Video posts as one type of post

For the sake of brevity, let's say we have the following two classes in models.py: class ImagePost(models.Model): image = models.ImageField(...) # other Image related fields class VideoPost(...
0
votes
0answers
24 views

How can I extend a class in Node JS by my custom constructor?

I have the following in a Node Js model. This file exists in another project that cannot be changed but is locally available to the other projects. module.exports = { base: require('*/cartridge/...
-4
votes
0answers
33 views

What approach should I take to model forecasting problem in machine learning? [closed]

I have a dataset which contains 4000k rows and 6 columns. The goal is to predict travel time demand of a taxi. I have read many articles regarding how to approach the problem. So, every writer tell ...
0
votes
1answer
14 views

Sequelize - map fields to field alias in model definition

I am defining a Sequelize model to map fields from existing tables in my database. However, the field names in the table are long and not developer-friendly. Is it possible to map the database field ...
0
votes
0answers
19 views

How to save models in memory in Microsoft Azure?

I want to save the models in memory so next time I don't need to load the models again for time concerns. Right now I am using Azure Function to create a server-less application, so is there any ...
0
votes
0answers
10 views

Illegal offset type, trying to save object

code in controller. $this->validate($request,[ 'user_id'=>'required', 'book_id'=>'required', 'rating'=>'required']); have a composite primary key. $rate = ...
-1
votes
1answer
15 views

Broadcast model updated event only to others

The problem I need to broadcast the model event to everyone except to the one who sent the request. (The one who created the last message). I wish to do something like broadcast(new ChatUpdated)->...
0
votes
0answers
22 views

Django: Populate a table based on incerted value from other table

I need to set a start date and end date on a table (Week) and based on these values, another table (Day) is automatically populated with the days between those dates. My models are: class Week(...
0
votes
0answers
12 views

Learning hmm from Baum-Welch Algorithm

I am not able to find the specific use case of Baum-Welch algorithm wherein the algorithm is used to train the parameters of model and yet keep the states as original states. For example, I can use ...
-3
votes
0answers
26 views

How to code my data for linear model in R?

I wanna do the linear model to analyse my data using lm function. Days are a subcategory of phase. My model is Grazing= Phase+ID+Phase*ID+Error This is my data format ID Phase Day Grazing 1 1 ...
1
vote
1answer
38 views

Django - How to return all objects in a QuerySet in their subclass form, rather than their parent class form?

I have a class Set with a many-to-many relationship to Item. I have lots of 'set' objects all containing lots of 'items'. However, the Item class has been subclassed to create Article, Podcast, ...
-1
votes
1answer
33 views

how to make condition to check duplicate/same value in java

im new with java and flink. i still fail to make condition to check duplicate or same value from same field in 2 table. so i have 1 service file and 1 model file. i already use some code like next(),...
0
votes
1answer
10 views

What is the best apporach to create a Model class from DB table

I am trying to use a table suppose Account table from database containing 20 around columns and for different views I have requirement of different columns like for basic entries I need 10 columns for ...
0
votes
1answer
25 views

How to Display or Show FK “Name” or “Title” instead of FK “ID”

I have two tables, one is "Souvenirs" table and another one is "Categories" table. Souvenir from "Souvenirs" table has FK "CategoryID" that is related to "Categoreis" table. The problem is that when I ...
0
votes
1answer
20 views

Django saving, deleting and viewing user uploaded media with same name

I have a profile app, where users can upload a profile picture. I save the picture with the user's username eg. ifakih.jpg. If that file already exists, and they want to change their profile picture, ...
1
vote
1answer
19 views

Django - Foreingkey relationship requires field

I have the following Foreignkey relationship between two models: class Text(models.Model): textcontent = models.CharField(max_length=100) class Comment(models.Model): text = models....
0
votes
0answers
20 views

How to fix rank problem when merge two models in keras?

I want to merge two models in keras model A: encoder+decoder model B: pre-trained image classifier model A = encoder+decoder model = Sequential() model.add(layers.Conv2D(16, kernel_size=3, ...
1
vote
2answers
23 views

How to extract coefficients in “cv.rq.pen” function in R?

library(rqPen) n <- 60 p <- 7 rho <- .5 beta <- c(3,1.5,0,2,0,0,0) R <- matrix(0,p,p) for(i in 1:p){ for(j in 1:p){ R[i,j] <- rho^abs(i-j) } } set.seed(1234) x <- matrix(...
0
votes
1answer
41 views

validating attribute presence with condition

I am trying to introduce a functionality in my application in which the users can suggest an event to the organizers.To suggest an event the user will have to fill a form. I want to validate the ...