Wednesday, June 27, 2012

Re: ManyToManyField is this right?

On Wed, 27 Jun 2012 11:48:22 -0700, David Wagner <cptnwinky@gmail.com>
declaimed the following in gmane.comp.python.django.user:

> Looking at that I think I may need to add a foreignkey to cert_types
> relating to person since a person can have multiple certification types
> (NRA Instructor, CCL Instructor, etc).

Well, this has just added a different aspect... That of INSTRUCTOR
(my memory of the first messages came across more as a certificate that
one had attended a course <G>, not that it meant they could teach the
course).

In the case of instructors -- what is the difference between "NRA"
and "CCL" instructor? "NRA" specifies an organization that provides the
certification in /something/, but "CCL" is a /something/ but who issues
it?

Okay, looking at these as teaching certificates...

Certificates
ID #primary key
Name #text string for the common name of the class
IssuingAuthority #NRA or government entity
DateFirstAuthorized #not date of issuance, but a double check that
#an issued certificate date does not come
#before the "class" was created
RenewalPeriod #how often the certificate needs to be renewed

Persons
ID
Name
Address
whatever

Issued #or PersonsCertificates if you want to name the sources
ID
pID foreign key (Persons.ID) #who this certificate was issued to
cID foreign key (Certificates.ID) #what type of certificate
DateIssued #constraint DateIssued > DateFirstAuthorized
CertificateNumber #document number
DateExpires #for things that need to be renewed periodically
#= DateIssued + RenewalPeriod
UniqueKey (pID, cID, CertificateNumber)
#including certificate number means you can track renewals
#as a renewal would have a different serial number

This is a many-to-many between Persons and Certificates, in which
the intersection table (Issued) contains additional information.


--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/

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

No comments:

Post a Comment