diff -r 000000000000 -r 0b061d58aea3 testappproj/testapp/models.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testappproj/testapp/models.py Mon May 17 22:33:59 2010 +0530 @@ -0,0 +1,70 @@ +from django.db import models +from django.contrib.auth.models import User +from django.contrib.auth.models import Group, Permission + + + +# class ProblemPermission(models.Model): +# """Abstract page permissions +# """ +# #who +# user = models.ForeignKey(User) +# #what +# can_change = models.BooleanField("can edit", default=False) +# can_add = models.BooleanField("can add", default=False) +# can_delete = models.BooleanField("can delete", default=False) + + +# class Meta: +# abstract = True +# app_label = 'testapp' + +PROBLEM_CHOICES=( + ('P', 'Plotting'), + ('S', 'Scripting'), +) + + +SESSION_CHOICES=( + ('A','DAY 1 SESSION 1'), + ('B','DAY 1 SESSION 2'), + ('C','DAY 1 SESSION 3'), + ('D','DAY 1 SESSION 4'), + ('E','DAY 2 SESSION 1'), + ('F','DAY 2 SESSION 2'), + ('G','DAY 2 SESSION 3'), + ('H','DAY 1 SESSION 4'), + ) + +class Problem(models.Model): + # name = models.CharField(blank=False,max_length=255) + description = models.CharField(blank=False , max_length=255) + problem_type=models.CharField(blank = False ,max_length=1, choices=PROBLEM_CHOICES) + solution = models.CharField(blank=True ,max_length=255) + solution_image = models.ImageField(blank = True ,upload_to='plots') + session = models.CharField(blank=False ,max_length=1,choices=SESSION_CHOICES) + author = models.CharField(max_length=255) + created = models.DateTimeField() + modified = models.DateTimeField() + + + + #if user.has_perm('testapp.add_bar') and user.has_perm('foo.change_bar') and user.has_perm('foo.delete_bar') + +class Test_User(models.Model): + #problem = models.ForeignKey('Problem') + user = models.ForeignKey(User, unique=True) + fullname=models.CharField(max_length=255) + + + + + + + + + + + + +