resources.py 542 B

123456789101112131415161718192021
  1. from import_export import resources
  2. from .models import Project, ProjectKey
  3. class ProjectKeyResource(resources.ModelResource):
  4. class Meta:
  5. model = ProjectKey
  6. skip_unchanged = True
  7. fields = ("project", "label", "public_key")
  8. import_id_fields = (
  9. "project",
  10. "public_key",
  11. )
  12. class ProjectResource(resources.ModelResource):
  13. class Meta:
  14. model = Project
  15. skip_unchanged = True
  16. fields = ("id", "created", "slug", "name", "organization", "platform")