我有以下管理員設置,以便我可以同時添加/編輯用戶及其個人資料。 class ProfileInline(admin.StackedInline):
"""
Allows profile to be added when creating user
"""
model = Profile
class UserProfileAdmin(admin.Mode
According to the C FAQ不同的宏功能/內聯方法缺點,基本上有用於C「內聯」代碼3種的實用方法: #define MACRO(arg1, arg2) do { \
/* declarations */ \
stmt1; \
stmt2; \
/* ... */ \
} while(0) /* (no trailing ;) */
假設我在通常情況下那裏是在many2many關係帶來額外的字段: class Person(models.Model):
name = models.CharField(max_length=128)
class Group(models.Model):
name = models.CharField(max_length=128)
members = model