Hi there, please, I need your help people

I'm starting to develop web pages with frameworks, and this is my
first framework.

So, this is my problem. First let me give you an example.

Suppose this situation.
A student has: Name, Surname, Birthday and it has a Career.
A Carrer has many subjects. Carrers can share subjects (For example,
Calculus I and Calculus II is in System Engineering and Civil
Engineering, etc..)
Every Subject has: Name, Teachers, Type (Anual, etc..) and a
Comissions.
One commission is related with one subject. A subject can have several
commission.

This are my models:

class Career(models.Model):
    name = ...
    subject = models.ManyToManyField(Subject)

class Teacher(models.Model):
    name = ...
    surname = ...
    birthday= ...

class Alumno(models.Model):
    name = ...
    surname = ...
    birthday = ...
    career = models.ForeignKey(Career)

class Subject(models.Model):
   ...
    name =..
    teachers = models.ManyToManyField(Teacher)
    type= ...

class Commission(models.Model):
    subject = models.ForeignKey(Subject)
    identification = ...
    students = models.ManyToManyField(Student)

Ok, now. Suppose that i have students in System Engineering and
students in Civil Engineering.
Now, i want to add a Commision (called A) to the subject Calculus,
with students from System Engineering. Now, when i'm adding the
students to the commission, the field is mixed with students from the
other carrer, so now i have System and Civil students mixed when i
only want to add students of System. How do i fix this? (Basicc

This is the code for "Subject" in admin.py, and i will upload a
screenshot.
Thanks people!

class CommissionsAdmin(admin.TabularInline):
    model = Commission
    extra = 3

class SubjectAdmin(admin.ModelAdmin):
    fields = ['name','type','teachers',]
    inlines = [CommissionsAdmin]

admin.site.register(Subject, SubjectAdmin)

Screenshot
http://i56.tinypic.com/2iied1z.jpg

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to