| django-polymodels. تنفيذ نماذج متعددة الأعمدة ل django |
التحميل الان |
django-polymodels. الترتيب والملخص
- رخصة:
- MIT/X Consortium Lic...
- اسم الناشر:
- Simon Charette
- موقع ويب الناشر:
- https://github.com/charettes/
django-polymodels. العلامات
django-polymodels. وصف
Django-polymodels هو تطبيق Django يوفر طريقة بسيطة لاسترداد نوع النماذج المصبين على Contenttypepepe.Installationpip تثبيت PolymodelsMake بالتأكيد `` django.contrib.contenttypes'` `` polymodels'` '' في `prection_apps الخاص بك `:: packet_apps + = = ('django.contrib.contentypes'، PolymorphiCModel الفئة الحيوان (PolymorphiCmodel): name = models.charfield (max_length = 255) def __unicode __ (الذات): عودة self.name class mammal (حيوان): pass class dog (mammal): pass class الزواحف (الحيوان): (الزواحف): Meta Class: الوكيل: يتم إنشاء TREAOBJECTS بنفس الطريقة مثل المعتاد ويتم حفظ `` contenttype``s تلقائيا. >>> الحيوان = الحيوانات. = mammal.objects.create (الاسم = "الثدييات") >>> الزواحف = reptile.Objects.create (الاسم = الزواحف ") >>> Snake = Snake.Objects.create (N AME = 'Snake') Retreive * Type Cented * مثيلات من مدير `` animal.Objects`` يجب عليك فقط استخدام طريقة `` select_subclasses` ">>> animal.Objects.Select_subclasses () [ الحيوان>،
django-polymodels. برامج ذات صلة