Django - need to split a table across multiple locations [closed]
- by MikeRand
Hi all,
I have a Django project to track our company's restructuring projects. Here's the very simple model:
class Project(models.Model):
code = models.CharField(max_length=30)
description = models.CharField(max_length=60)
class Employee(models.Model):
project = models.ForeignKey(Project)
employee_id = models.IntegerField()
country_code = models.CharField(max_length=3)
severance = models.IntegerField()
Due to regulations in some European countries, I'm not allowed to keep employee-level severance information in a database that sits on a box outside of that country.
In Django, how do I manage the need to have my Employee table split across multiple databases based on an Employee attribute (i.e. country_code) in a way that doesn't impact anything else in the project (e.g. views, templates, admin)?
Thanks,
Mike