testappproj/testapp/models.py
changeset 1 0eda880b3d25
parent 0 0b061d58aea3
child 3 34d0c21e3352
equal deleted inserted replaced
0:0b061d58aea3 1:0eda880b3d25
    44   solution_image = models.ImageField(blank = True ,upload_to='plots')
    44   solution_image = models.ImageField(blank = True ,upload_to='plots')
    45   session = models.CharField(blank=False ,max_length=1,choices=SESSION_CHOICES)
    45   session = models.CharField(blank=False ,max_length=1,choices=SESSION_CHOICES)
    46   author = models.CharField(max_length=255)
    46   author = models.CharField(max_length=255)
    47   created = models.DateTimeField()
    47   created = models.DateTimeField()
    48   modified = models.DateTimeField()
    48   modified = models.DateTimeField()
    49   
    49   credit=models.IntegerField()
    50 
    50 
    51 
    51 
    52   #if  user.has_perm('testapp.add_bar') and  user.has_perm('foo.change_bar') and user.has_perm('foo.delete_bar')
    52   #if  user.has_perm('testapp.add_bar') and  user.has_perm('foo.change_bar') and user.has_perm('foo.delete_bar')
    53 
    53 
    54 class Test_User(models.Model):
    54 class Test_User(models.Model):
    55   #problem = models.ForeignKey('Problem')
    55   #problem = models.ForeignKey('Problem')
    56   user = models.ForeignKey(User, unique=True)
    56   user = models.ForeignKey(User, unique=True)
    57   fullname=models.CharField(max_length=255)
    57   fullname=models.CharField(max_length=255)
    58 
    58 
    59   
    59   
    60 
    60 class Score(models.Model):
       
    61   user = models.ForeignKey(User, unique=True)
       
    62   total_credits=models.IntegerField(default=0,blank=False)
    61   
    63   
    62 
    64 
    63 
    65 
    64   
    66   
    65   
    67