[mezzanine-users] Trying to use 'inline' in Admin with a many to many relationship

2015-02-27 Thread Graham Oliver
I have a class 'Happening' with a ManyToMany relationship to  'Span' as 
follows

class Happening(Page, RichText):
spans = models.ManyToManyField(Span)

class Span(Slugged):
start_date = models.DateField()
end_date = models.DateField()
start_time = models.TimeField
end_time = models.TimeField

In the admin for Happening I want the Span fields to appear (I believe the 
term is 'inline')

I did this in admin.py
class HappeningSpanInline(DynamicInlineAdminForm):
model = Happening.spans.through

class HappeningAdmin(PageAdmin):

Admin class for Happenings.

inlines = [HappeningSpanInline,]
fieldsets = happening_fieldsets

However when I try to run the server I get this message

django.core.exceptions.ImproperlyConfigured: 'HappeningAdmin.inlines[0]' 
does not inherit from BaseModelAdmin.

Some help would be appreciated.
Regards g


-- 
You received this message because you are subscribed to the Google Groups 
Mezzanine Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Customizing Drum

2015-02-27 Thread Josh Cartmell
Hi Jason, I would take a look over this section of the Mezzanine docs:

http://mezzanine.jupo.org/docs/model-customization.html

It should have all the answers you need.

Good luck!

On Thu, Feb 26, 2015 at 4:17 PM, Jason Augustyn js.augus...@gmail.com
wrote:

 Hi, I'm trying to use Drum (which is awesome) to hack together an
 application and wondered how to add custom fields to the Link model? I
 tried putting a copy of models.py and forms.py in my project directory and
 editing them, but the site still displays the base Drum link form fields.

 I read through the original Drum post
 http://blog.jupo.org/2013/04/30/building-social-apps-with-mezzanine-drum/,
 but didn't see anything about how to override default models and forms. The
 Mezzanine documentation wasn't very clear on this account either.

 Thank you for any and all help!

  --
 You received this message because you are subscribed to the Google Groups
 Mezzanine Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to mezzanine-users+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Mezzanine Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.