Permalink
Browse files

Adaptando models para trabalhar com o pacote registration

  • Loading branch information...
1 parent ba8b1f7 commit db92f0f10fd678cb70b8c70ccc944a1012d0a0c3 @renatomenegasso committed Apr 21, 2012
Showing with 10 additions and 31 deletions.
  1. +3 −6 bands/models.py
  2. +6 −25 equipaments/admin.py
  3. +1 −0 labandas/settings.py
View
@@ -1,21 +1,18 @@
from django.db import models
from equipaments.models import Equipament
+from registration.models import RegistrationProfile
class MusicalStyle(models.Model):
name = models.CharField(max_length=50)
image = models.CharField(max_length=255, null=True,blank = True)
def __unicode__(self):
return self.name
-class Musician(models.Model):
- name = models.CharField(max_length=50)
- email = models.CharField(max_length=50)
- password = models.CharField(max_length=50)
- registration_date = models.DateTimeField('Registration date')
+class Musician(RegistrationProfile):
equipaments = models.ManyToManyField(Equipament)
musical_styles = models.ManyToManyField(MusicalStyle)
def __unicode__(self):
- return self.name
+ return self.user.first_name + " " + self.user.last_name
class Band(models.Model):
name = models.CharField(max_length=50)
View
@@ -1,26 +1,7 @@
-from django.db import models
-from equipaments.models import Equipament
+from django.contrib import admin
+from equipaments.models import Category, Brand, EquipamentType, Equipament
-# Create your models here.
-
-class MusicalStyle(models.Model):
- name = models.CharField(max_length=50)
- image = models.CharField(max_length=255, null=True,blank = True)
- def __unicode__(self):
- return self.name
-
-class Musician(models.Model):
- name = models.CharField(max_length=50)
- email = models.CharField(max_length=50)
- equipaments = models.ManyToManyField(Equipament)
- musical_styles = models.ManyToManyField(MusicalStyle)
- def __unicode__(self):
- return self.name
-
-class Band(models.Model):
- name = models.CharField(max_length=50)
- musicians = models.ManyToManyField(Musician)
- registration_date = models.DateTimeField('Registration date')
- musical_styles = models.ManyToManyField(MusicalStyle)
- def __unicode__(self):
- return self.name
+admin.site.register(Category)
+admin.site.register(Brand)
+admin.site.register(EquipamentType)
+admin.site.register(Equipament)
@@ -123,6 +123,7 @@
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
+ 'registration',
'equipaments',
'medias',
'bands',

0 comments on commit db92f0f

Please sign in to comment.