Questions tagged as 'model'

2
answers

Is it correct in MVC to access data within the model?

In a C # MVC project, is it okay to access data within the model ? For example: public class Cliente { public int Id { get; set; } public string Nome { get; set; } //outros atributos... public void Inserir(){ Client...
asked by 26.10.2017 / 16:16
1
answer

Field handling in the Model before writing to the database (Python + Django)

I am trying to perform a password encryption using Python 3.7 and Django 2.1. Looking at the Python documentation, Django and some answers here in StackOverflow, I came up with the code as follows, however, the password field is written blank...
asked by 31.08.2018 / 13:46
1
answer

Python, Django with multiple databases

To work with several databases in the Laravel framework, once you have configured all the connections in the configuration files, simply define in the model which connection to the database that model will use, and then regardless of the operati...
asked by 17.12.2017 / 22:25
0
answers

What is the best technique for using ViewModel with mvc C # lists?

I have two templates: event registration package and subscription package, where the template event registration package has a list of subscription packages (see the code below, I removed some fields). //Model public class PacoteInscricaoEvent...
asked by 09.01.2018 / 13:37
1
answer

What is the most appropriate way to instantiate a database in an MVC pattern

I'm studying OOP and a little bit about the MVC structure, and I'm not sure where to create and instantiate the database to be used in the entire application, I thought how Model relates to data processing would be the best place to create the s...
asked by 14.05.2017 / 03:13
1
answer

CakePHP 3 - How to do rollback

In cakephp 2, you save them in a transactional way with $data_source->begin(); , $data_source->commit(); , or $data_source->rollback(); . So when I needed to insert into more than one table, and the data would be depen...
asked by 13.12.2016 / 21:12
0
answers

Spring + JPA, transient field visible in View and not persistent?

Good evening guys, I have a filter that I do manually with @query () that in it I do a total calculating join of a sale ie SUM(valor * quantidade) as total I'm not sure what to do. what happens is this, this total "temporary" field that ref...
asked by 13.08.2018 / 23:46
0
answers

How to update only one property of an object using OutputCache in ActionResult

Hello, everyone. I have a problem that I do not even know if there is a solution like this. I have an ActionResult that returns the contents of a chart in Jquery. The result of this graphic will always need to be cached so page does not...
asked by 27.09.2017 / 19:11
1
answer

Angular: error in model with object listing

I have these 2 templates, and the book has a list of language objects. Model book import { Language} from "./language"; export class Book { id: number; name: string; language: Array<Language>; } Model language export class L...
asked by 27.12.2018 / 18:09
1
answer

PHP MVC - How to execute Model methods?

Good afternoon! How do I execute a method of the Model class, in specific a method of insertion to the DB, in case I need to send the data of the Form. This is the form in View (sector.php): <form method="POST" enctype="multipart/form...
asked by 27.07.2018 / 21:01