Questions tagged as 'model'

1
answer

Calculating a date within the Model Django timedelta

I'm declaring a function (data_prox_prog) to calculate a future date and store in the model, but it's not happening as expected. Here is the code: class ProgressaoDocente(models.Model): servidor = models.ForeignKey(Servidor, on_delete=models.P...
asked by 02.09.2018 / 04:56
1
answer

AutoMapper Relationship One to Many - Model to ViewModel (and vice versa)

MVC scenario, where Controller talks to Application that talks to Domain. I'm trying to do a one-to-many mapping with AutoMapper. This is my Model: public class Estado { public Guid EstadoId { get; set; } public string Nome { get...
asked by 29.01.2017 / 18:10
1
answer

Django 2.0.9 - MultiSelectFormField - Parameter to make non-mandatory

I want to make the MultiSelectField field not mandatory. When I do not choose any of the options the validation is accusing Required field . I've tried using the parameters blank = True and null = True, but still continue to accuse the field...
asked by 12.11.2018 / 17:07
0
answers

Retrieve values from Partial View to View Parent

I'm developing a screen in AspNet Mvc where I have an index screen that has a model called ParameterizationVM and on that screen I have a partialView that displays the units (which is a List<Unidades> that is contained in the parame...
asked by 09.08.2018 / 16:04
0
answers

How to change the Model data being displayed in GridMvc?

I have a GridMvc in my form where it displays a list of units, in this grid has a text field, and a checkbox, I would like when the user type some text box or flag the check, that change reflects on the model. / p> View: <b>Seleci...
asked by 01.08.2018 / 17:04
1
answer

Popular a View with Values in ASP.NET MVC Model

In the Index Method I can set values in the model and initialize my VIEW with pre-defined values. But when I do the POST to the START method, when I change the Aquedica property, the value is not being passed to the view, this actually happens w...
asked by 14.06.2018 / 15:21
0
answers

What is the best way to pass data from the model database to the view?

Hello everyone. I have some questions: We assume that I want to display a table of files that are registered in the database. In my FilesController.php, I have: public function carregarLista($status){ $this->arquivosModel->set...
asked by 02.05.2018 / 18:34
0
answers

What is the best way to popular and link 3 Data Model Classes?

I have 3 Models that are populated by 3 procedures . Home Is there a smarter way to popular these and Models ? Models: public class Clientes { public int IdCliente { get; set; } public string Nome {...
asked by 22.03.2018 / 01:27
1
answer

Trying to get property 'name' of non-object Laravel Eloquent Error pulling foreign key data [duplicate]

I'm trying to use relationships to display data on the screen but I get the following error:    Trying to get property 'name' of non-object In this command $recebimento->planoconta()->get()->first()->nome MODEL ACCOUNT...
asked by 15.02.2018 / 14:28
1
answer

Laravel Recursion?

Next, in my model : public function indicacao() { return $this->hasMany(User::class, 'indicacao','name'); } public function todasindicacoes() { return $this->indicacao()->with('todasindicacoes'); } and my controll...
asked by 02.01.2018 / 22:56