Answer the question
In order to leave comments, you need to log in
Models in MVC/MVP patterns?
Hello everyone, I'm trying to figure out the MVC and MVP patterns.
I am writing a large desktop application (more precisely, I am going to rewrite).
I seem to understand these patterns, but I want to understand one point.
As far as I understand, a model is an object of a class that provides data and logic for the view.
For example, we work with workers in an enterprise:
There is a WorkerModel class that describes a worker and methods for working with him.
But what if I need to display a list of all workers, and for example, count how many laid off, or something else. As I understand it, I need to create a new model of the WorkerListModel type, which will already have methods for working with a list of workers, and for example, counting laid off, and so Further?
I write in simple language, so do not swear.
Answer the question
In order to leave comments, you need to log in
But what if I need to display a list of all workers,
class WorkerRepository(object):
def __init__(self, DBSession)
def get_dismissed_count(self, count)
def get_all(self)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question