This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Método que chama a geração de relatório | |
public void visualizarRelatorio(){ | |
// Montando o Map pra passar para o query interna. | |
HashMap<String, Object> argumentos = new HashMap<>(); | |
argumentos.put("unidade", sessaoUsuarioMB.getUnidadeSelecionada()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from masonite.provider import ServiceProvider | |
from masonite.routes import Route | |
class RouteCompilerProvider(ServiceProvider): | |
wsgi = False | |
def boot(self, route: Route): | |
route.compile('any', r'(.+)') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modelo | |
class Championship{ | |
static ranking = [] | |
static rounds = [] | |
static new(){ | |
Championship.ranking = TeamGenerator.generate() | |
return Championship |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package bean; | |
import javax.faces.application.FacesMessage; | |
import javax.faces.context.FacesContext; | |
import dao.VacinaDao; | |
import entidades.Vacina; | |
import java.util.List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def validate(self, attrs): | |
whatsapp = attrs.get('whatsapp', self.object.whatsapp) | |
whatsapp_h = attrs.get('whatsapp_h', self.object.whatsapp_h) | |
prontuario = attrs.get("prontuario", self.object.prontuario | |
try: | |
obj = tb_Paciente.objects.filter(whatsapp=whatsapp, whatsapp_h=whatsapp_h, prontuario=prontuario).exists | |
() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ModelA(models.Model): | |
a = models.CharField() | |
b = models.CharField() | |
c = models.CharField() | |
def save(self, *args, **kwargs): | |
c = self.a + self.b | |
super().save(*args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ITEM1 | 1 | 11 | COMPRA1 | 444444 | 00 | 3312 | 22 | |
---|---|---|---|---|---|---|---|---|
ITEM1 | 1 | 11 | COMPRA3 | 444444 | 00 | 3312 | 22 | |
ITEM1 | 1 | 13 | COMPRA2 | 444444 | 00 | 3312 | 22 | |
ITEM1 | 1 | 90 | COMPRA3 | 444444 | 00 | 3312 | 22 | |
ITEM2 | 1 | 20 | COMPRA2 | 444444 | 00 | 3312 | 22 | |
ITEM2 | 2 | 19 | COMPRA1 | 444444 | 00 | 3312 | 22 | |
ITEM2 | 1 | 11 | COMPRA1 | 444444 | 00 | 3312 | 22 | |
ITEM2 | 1 | 12 | COMPRA2 | 444444 | 00 | 3312 | 22 | |
ITEM3 | 1 | 11 | COMPRA1 | 444444 | 00 | 3312 | 22 | |
ITEM3 | 5 | 60 | COMPRA3 | 444444 | 00 | 3312 | 22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String toJson() throws JsonProcessingException { | |
ObjectMapper mapper = new ObjectMapper(); | |
return mapper.writeValueAsString(this); | |
} | |
public PessoaFisica toModel() { | |
SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy"); | |
ObjectMapper mapper = new ObjectMapper(); | |
mapper.setDateFormat(df); | |
return mapper.convertValue(this, OBJ.class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# api.py | |
from masonite.routes import Route | |
ROUTES = [ | |
Route.get('/podcasts', 'api.PodcastController@index') | |
] | |
# web.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyProvider(Provider): | |
def __init__(self, application): | |
self.application = application | |
def register(self): | |
Gate.register_policies([(Project, ProjectPolicy)]) | |
def boot(self): | |
pass |