通过django中的管理面板分配子用户

时间:2013-03-08 15:29:11

标签: django

我在models.py中有以下内容     来自django.db导入模型

class LabName(models.Model):
labsname=models.CharField(max_length=30)
def __unicode__(self):
 return self.labsname

class ComponentDescription(models.Model):
   lab_Title=models.ForeignKey('Labname')
    component_Name = models.CharField(max_length=30)
   description = models.CharField(max_length=20)
   purchased_Date = models.DateField()
   status = models.CharField(max_length=30)
   to_Do = models.CharField(max_length=30,blank=True) 
   remarks = models.CharField(max_length=30)

   def __unicode__(self):
   return self.component

我的admin.py

中有以下内容
from django.contrib import admin
from Lab_inventory.models import ComponentDescription,LabName
class ComponentDescriptionAdmin(admin.ModelAdmin):
list_display=('lab_Title','component_Name','description','qty','purchased_Date','status','to_Do','remarks')
   list_filter=('lab_Title','status','purchased_Date')
admin.site.register(LabName)
admin.site.register(ComponentDescription,ComponentDescriptionAdmin)

如何为每个labnames ????

分配不同的子用户

0 个答案:

没有答案