tom
unread,Jul 4, 2008, 2:31:00 AM7/4/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Hi,
I have an abstract class for some generic information about contact
information and need to have those fields in a number of other Models.
Therefore I defined the Contact Model as abstract:
class Contact(models.Model):
"""
Meta class for all models which needs to have contacts stored
"""
first_name = models.CharField(max_length = 30, blank = True)
last_name = models.CharField(max_length = 30, blank = True)
street = models.CharField(max_length = 30, blank = True)
zip = models.SmallIntegerField(blank = True)
address = models.CharField(max_length = 30, blank = True)
# Phone Stuff
mobile = models.PhoneNumberField(blank = True)
landline = models.PhoneNumberField(blank = True)
fax = models.PhoneNumberField(blank = True)
class Meta:
abstract = True
class Admin:
fields = (
(None, {'fields': ((' first_name', 'last_name'),)}),
('Address', {'fields': ('street', 'zip', 'address')}),
('Phone and Fax', {'classes': 'collapse',
'fields': ('mobile', 'landline',
'fax')}),
)
js = ('/m/js/tiny_mce/tiny_mce.js',
'/m/js/tiny_mce/textareas.js')
what's important for me is, that I need to group some fields within
the admin interface to make it "pretty" for editors. But when I use it
the way it is listed further up, it simply does not show up as
expected.
When I add the Admin stuff in the SubClass django throws an error,
because the fields are unknown.
Is there a way around it?
Many thanks and best regards,
Tom