Django

Code

Ticket #8437 (new)

Opened 4 months ago

Last modified 4 months ago

Feature Request: distinct_between('team_home', 'team_away') similar to unique_together

Reported by: ritlim Assigned to: nobody
Milestone: post-1.0 Component: Database layer (models, ORM)
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

class Game(models.Model):
    team_home = models.ForeignKey(Team, related_name="games_home")
    team_away = models.ForeignKey(Team, related_name="games_away")

    class Meta:
        distinct_between = ('team_home', 'team_away')

"distinct_between" should add this constraint to the database:

CHECK(team_home IS DISTINCT FROM team_away)

Attachments

Change History

08/20/08 06:40:08 changed by anonymous

  • needs_better_patch changed.
  • needs_docs changed.
  • needs_tests changed.
  • milestone set to post-1.0.

Add/Change #8437 (Feature Request: distinct_between('team_home', 'team_away') similar to unique_together)




Change Properties
Action