> So should I just create two classes that are identical but name one
> CurrentElectionResults and the other PastElectionResults?

That would be one way of doing it. There are promises of subclassable
(?) Models in the works, but it hasn't been released yet.

If there are a fair number of methods connected with the class, you
could avoid duplicating them by creating a third class and then using
multiple inheritance for the two models. A project I recently finished
had a dozen different types of content objects (articles, q&a, videos,
etc.), each with unique aspects to it, but all of which needed
functions for determining parent sections, building breadcrumbs, etc.
etc., and this technique handled it nicely.

E.g.

class ElectionResultMethods:
  """Common methods for the two ElectionResult classes""
  def foo(self):
      pass
  def bar(self):
      pass

class CurrentElectionResults(models.Model, ElectionResultsMethods):
   etc.

class PassElectionResults(models.Model, ElectionResultsMethods):
   etc.

  HTH,
  Peter
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to