forked from PyAr/pyarweb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP - Comenzando la app profiles. PyAr#299
- Loading branch information
Showing
14 changed files
with
130 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"fields": {"created": "2015-06-24T03:04:27.259Z", "modified": "2015-06-24T03:04:27.260Z", "nombre": "Skype"}, "pk": 1, "model": "profiles.medioscontactos"}, {"fields": {"created": "2015-06-24T03:04:35.128Z", "modified": "2015-06-24T03:04:35.129Z", "nombre": "Email"}, "pk": 2, "model": "profiles.medioscontactos"}, {"fields": {"created": "2015-06-24T03:04:41.107Z", "modified": "2015-06-24T03:04:41.108Z", "nombre": "Facebook"}, "pk": 3, "model": "profiles.medioscontactos"}, {"fields": {"created": "2015-06-24T03:04:48.125Z", "modified": "2015-06-24T03:04:48.126Z", "nombre": "Blog Personal"}, "pk": 4, "model": "profiles.medioscontactos"}, {"fields": {"created": "2015-06-24T03:05:00.854Z", "modified": "2015-06-24T03:05:00.855Z", "nombre": "Celular"}, "pk": 5, "model": "profiles.medioscontactos"}, {"fields": {"created": "2015-06-24T03:05:17.933Z", "modified": "2015-06-24T03:05:17.934Z", "nombre": "Tel\u00e9fono Fijo"}, "pk": 6, "model": "profiles.medioscontactos"}, {"fields": {"created": "2015-06-24T03:05:23.714Z", "modified": "2015-06-24T03:05:23.715Z", "nombre": "LinkedIn"}, "pk": 7, "model": "profiles.medioscontactos"}] |
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from django.contrib import admin | ||
from .models import MediosContactos | ||
|
||
admin.site.register(MediosContactos) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models, migrations | ||
import django.utils.timezone | ||
import taggit_autosuggest.managers | ||
from django.conf import settings | ||
import model_utils.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('taggit', '0001_initial'), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='MediosContactos', | ||
fields=[ | ||
('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), | ||
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), | ||
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), | ||
('nombre', models.CharField(max_length=150)), | ||
], | ||
options={ | ||
'ordering': ['-created'], | ||
}, | ||
bases=(models.Model,), | ||
), | ||
migrations.CreateModel( | ||
name='Profiles', | ||
fields=[ | ||
('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), | ||
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), | ||
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), | ||
('tutor', models.BooleanField(default=False, verbose_name='Querés enseñar?')), | ||
('tutorado', models.BooleanField(default=False, verbose_name='Querés recibir ayuda de un tutor?')), | ||
('disponibilidad_semanal', models.IntegerField(verbose_name='Cantidad de horas semanales')), | ||
('intereses', taggit_autosuggest.managers.TaggableManager(help_text='A comma-separated list of tags.', blank=True, verbose_name='Que temas te interesan?', to='taggit.Tag', through='taggit.TaggedItem')), | ||
('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)), | ||
], | ||
options={ | ||
'ordering': ['-created'], | ||
}, | ||
bases=(models.Model,), | ||
), | ||
migrations.CreateModel( | ||
name='ProfilesMediosContactos', | ||
fields=[ | ||
('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), | ||
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), | ||
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), | ||
('valor', models.CharField(max_length=150)), | ||
('preferido', models.BooleanField()), | ||
('publico', models.BooleanField()), | ||
('medio_contacto', models.ForeignKey(to='profiles.MediosContactos')), | ||
('profile', models.ForeignKey(to='profiles.Profiles')), | ||
], | ||
options={ | ||
'ordering': ['-created'], | ||
}, | ||
bases=(models.Model,), | ||
), | ||
] |
Empty file.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from django.db import models | ||
from django.contrib.auth.models import User | ||
from django.utils.translation import ugettext_lazy as _ | ||
from taggit_autosuggest.managers import TaggableManager | ||
from model_utils.models import TimeStampedModel | ||
|
||
|
||
class Profiles(TimeStampedModel): | ||
""" | ||
Perfiles de usuarios | ||
""" | ||
user = models.OneToOneField(User) | ||
tutor = models.BooleanField(verbose_name=_("Querés enseñar?"), | ||
default=False) | ||
tutorado = models.BooleanField(verbose_name=_("Querés recibir ayuda de un tutor?"), | ||
default=False) | ||
disponibilidad_semanal = models.IntegerField(verbose_name=_("Cantidad de horas semanales")) | ||
intereses = TaggableManager(verbose_name=_('Que temas te interesan?'), blank=True) | ||
|
||
class Meta: | ||
ordering = ['-created'] | ||
|
||
|
||
class MediosContactos(TimeStampedModel): | ||
""" | ||
Medios de contactos, ejemplo: Skype, Facebook, Email, etc | ||
""" | ||
nombre = models.CharField(blank=False, max_length=150) | ||
|
||
def __unicode__(self): | ||
return self.nombre | ||
|
||
def __str__(self): | ||
return u'{0}'.format(self.nombre) | ||
|
||
class Meta: | ||
ordering = ['-created'] | ||
|
||
|
||
class ProfilesMediosContactos(TimeStampedModel): | ||
""" | ||
Relacion perfiles con medios de contactos | ||
""" | ||
profile = models.ForeignKey(Profiles) | ||
medio_contacto = models.ForeignKey(MediosContactos) | ||
valor = models.CharField(max_length=150) | ||
preferido = models.BooleanField(blank=False) | ||
publico = models.BooleanField(blank=False) | ||
|
||
class Meta: | ||
ordering = ['-created'] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.shortcuts import render | ||
|
||
# Create your views here. |
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