This file contains hidden or 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
| @Override | |
| public Filter getFilter() { | |
| return new PlaceFilter(this, placeAll); | |
| } | |
| // Filter class | |
| private static class PlaceFilter extends Filter{ | |
| private final PlaceAdapter adapter; | |
| private final List<Place> original; | |
| private final List<Place> filtered; |
This file contains hidden or 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
| compile fileTree(dir: 'libs', include: ['*.jar']) | |
| compile project(':volley') | |
| compile 'com.squareup.picasso:picasso:2.1.1' | |
| compile 'com.google.android.gms:play-services-location:7.8.0' | |
| compile 'com.google.android.gms:play-services-analytics:7.5.0' | |
| compile 'com.android.support:palette-v7:21.0.0' | |
| compile 'com.android.support:appcompat-v7:22.1.1' | |
| compile 'com.google.android.gms:play-services-maps:7.5.0' | |
| compile 'com.android.support:support-v4:18.0.+' | |
| compile 'br.com.livroandroid:android-utils:1.0.0' |
This file contains hidden or 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 CidadeDetailViewTemplate(DetailView): | |
| model = Cidade | |
| context_object_name = 'city' | |
| template_name = "site/base.html" | |
| def get_object(self): | |
| obj = {} | |
| city = Cidade( | |
| estado=Estado.objects.get(uf=self.kwargs.get("uf").upper()), | |
| nome=self.kwargs.get("nome")).get_item_slugify() |
This file contains hidden or 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 CidadeDetailViewTemplate(DetailView): | |
| model = Cidade | |
| context_object_name = 'city' | |
| template_name = "site/base.html" | |
| def get_object(self): | |
| obj = {} | |
| city = Cidade( | |
| estado=Estado.objects.get(uf=self.kwargs.get("uf").upper()), | |
| nome=self.kwargs.get("nome")).get_item_slugify() |
This file contains hidden or 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
| $scope.init = function (data) { | |
| var city = angular.fromJson(data); | |
| $scope.city = JSON.parse(city.cidade)[0]; | |
| $scope.attraction = JSON.parse(city.atrativos); | |
| $scope.pictures = JSON.parse(city.fotos_atrativos); | |
| $scope.pontos = JSON.parse(city.pontos); | |
| var items = []; | |
| for (var i = 0; i < 100; i++) { | |
| items.push({ 'nome': "Atrativo " + String(i) }); | |
| } |
This file contains hidden or 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
| app.config(function ($interpolateProvider, $httpProvider) { | |
| $interpolateProvider.startSymbol('[['); | |
| $interpolateProvider.endSymbol(']]'); | |
| }); |
This file contains hidden or 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 FolhaPagamento(models.Model): | |
| matricula = models.BigIntegerField(u'Matricula', blank=True, null=True, db_index=True) | |
| servidor = models.CharField(u'servidor', max_length=500, blank=True, null=True, db_index=True) | |
| cod_setor = models.CharField(u'cod_setor', max_length=50, blank=True, null=True, db_index=True) | |
| setor = models.CharField(u'setor', max_length=500, blank=True, null=True, db_index=True) | |
| cod_cargo = models.BigIntegerField(u'cod_cargo', blank=True, null=True, db_index=True) | |
| cargo = models.CharField(u'cargo', max_length=500, blank=True, null=True, db_index=True) | |
| cod_funcao = models.BigIntegerField(u'cod_funcao', blank=True, null=True, db_index=True) | |
| funcao = models.CharField(u'funcao', max_length=500, blank=True, null=True, db_index=True) | |
| cod_vinculo = models.BigIntegerField(u'cod_vinculo',blank=True, null=True, db_index=True) |
This file contains hidden or 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 AmbienteInternoCreate(CreateView): | |
| """Views para inserção de um objeto Ambiente Interno""" | |
| model = AmbienteInterno | |
| form_class = AmbienteInternoFormOut | |
| template_name = "ambiente_interno/form.html" | |
| def get_success_url(self): | |
| return reverse_lazy('ambiente-interno-list') |
This file contains hidden or 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 AmbienteInternoFormOut(forms.ModelForm): | |
| """Form para ser usado no classe based views""" | |
| def __init__(self, *args, **kwargs): | |
| # Sobrescrevendo o Init para aplicar a regra CSS para todos os campos | |
| # do formularios | |
| from django.forms.fields import FileField | |
| super(AmbienteInternoFormOut, self).__init__(*args, **kwargs) | |
| for field in iter(self.fields): | |
| if isinstance(self.fields[field], FileField) is False: | |
| self.fields[field].widget.attrs.update({ |
This file contains hidden or 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 get_context_data(self, **kwargs): | |
| page = 1 | |
| context = super(BaseListView, self).get_context_data(**kwargs) | |
| context['display'] = self.list_display | |
| query_params = dict(self.request.GET) | |
| if query_params: | |
| for key, value in query_params.items(): | |
| if key not in ['csrfmiddlewaretoken', 'page']: | |
| self.url_pagination += "{}={}&".format(key, value[0].replace(" ", "+")) | |
| if query_params.get('csrfmiddlewaretoken'): |