from django.db import models

# Create your models here.

@@ -9,49 +9,956 @@
 ngo.
-db import models%0A%0A# Create your models here.
+contrib.auth.models import User%0Afrom django.db import models%0Afrom django.utils import timezone%0A%0Afrom system.models import Department, System%0A%0A%0Aclass DataSource(models.Model):%0A    source_types = (%0A        ('DB', 'database'),%0A        ('FTP', 'ftp'),%0A        ('SFTP', 'sftp')%0A    )%0A    create_user = models.ForeignKey(User, help_text='the user who create this datasource')%0A    create_time = models.DateTimeField(timezone.now(), help_text='create time')%0A    source_type = models.CharField(choices=source_types, max_length=5, help_text='specify the type of this datasource')%0A    host = models.GenericIPAddressField(protocol='both', unpack_ipv4=False, help_text='ip address of this datasource')%0A    port = models.IntegerField(default=0, help_text='port of this datasource')%0A    department = models.ForeignKey(Department)%0A    system = models.ForeignKey(System)%0A%0A    def __str__(self):%0A        return self.host%0A%0A    class Meta:%0A        db_table = 'DATASOURCE'
 %0A

add datasource model