Skip to content

Instantly share code, notes, and snippets.

View fhdez's full-sized avatar
🎯
Focusing

Fatima Hernández fhdez

🎯
Focusing
  • Puebla, México
View GitHub Profile
var idSeleccionado = 1; // Español
var nme = [
{id: 1, nombre: "Español", slug: "1-espanol"},
{id: 5, nombre: "Matemáticas", slug: "5-matematicas"},
{id: 8, nombre: "Exploración y Comprensión del Mundo Natural y Social", slug: "8-social"},
{id: 14, nombre: "Educación socioemocional", slug: "14-educacion-socioemocional"},
{id: 16, nombre: "Educación Física", slug: "16-educacion-fisica"}
];
console.log(nme);
console.log(nme[idSeleccionado]);
@fhdez
fhdez / admin.py
Last active September 4, 2018 18:26
class AsignaturaNMEAdmin(admin.ModelAdmin):
model = AsignaturaNME
list_display = get_fieldnames(model)
exclude = ['slug']
search_fields = ['nombre', 'CampoFormativoNME', 'grado']
class CustomModelChoiceField(forms.ModelChoiceField):
def label_from_instance(self, obj):
return "%s - %s - %s" % (obj.nombre, obj.ciclo.nivel, obj.ciclo)
# Se agrega field de control de Meds de nuevo modelo Educativo
is_nuevomodelo = models.BooleanField(
default=False,
verbose_name=u'MED nuevo modelo Educativo'
)
# Se agrega field para el nuevo modelo Educativo
aprendizajeesperado = models.ForeignKey(
'nuevomodelo.AprendizajeEsperadoNME',
related_name='meds',
# -*- coding: utf-8 -*-
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from redmag.nuevomodelo.manager import BaseNuevoModeloManager
from redmag.utils.slughifi import slughifi
class BaseCatalogoNME(models.Model):
@fhdez
fhdez / api_test.py
Created August 24, 2018 15:06
test de videos que le dieron clic los papás...
# en la api genero el action
class ParentSchoolViewSet(
GenericViewSet,
mixins.RetrieveModelMixin,
mixins.ListModelMixin,
mixins.CreateModelMixin,
mixins.PartialUpdateModelMixin,
mixins.DestroyModelMixin):
serializer_class = serializers.ParentSchoolSerializer
# -*- coding: utf-8 -*-
import re
import requests
import uuid
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Avg
# -*- coding: utf-8 -*-
from apns import APNs, Payload
from celery import shared_task
from django.conf import settings
from potencia.notifications.mobile import _get_users
vm.downloadcsv = function() {
$http({
method: 'GET',
url: '/api/v1/activities/record/'+vm.query.domain.id+'/csv',
params: {
'datesince': vm.query.datesince,
'dateto':vm.query.dateto,
'verbs':vm.query.verb
},
responseType: 'arraybuffer'
vm.downloadcsv = function() {
$http({
method: 'GET',
url: '/api/v1/activities/record/'+vm.query.domain.id+'/csv',
params: {
'datesince': vm.query.datesince,
'dateto':vm.query.dateto,
'verbs':vm.query.verb
},
responseType: 'arraybuffer'
vm.downloadcsv = function() {
$http({
method: 'GET',
url: '/api/v1/activities/record/'+vm.query.domain.id+'/csv',
params: {
'datesince': vm.query.datesince,
'dateto':vm.query.dateto,
'verbs':vm.query.verb
},
responseType: 'arraybuffer'