Ok. solved
I needed to redefine the fieldsets again:
class RoomInline(TabularDynamicInlineAdmin):
model = Room
extra =1
fieldsets = [
(
None,
{
'fields' : ["name","lotation","facilities","thumbnail","description
","size","_order"] #workaround as m2m facilities would not appear
},
)
]
Sábado, 31 de Maio de 2014 16:58:43 UTC+1, Ricardo Barbosa escreveu:
>
> I'm willing to pay a bounty for this. Half for this project and the other
> for the developer. Let me know if you're interested.
>
> Best Regards
>
> Sábado, 24 de Maio de 2014 8:55:44 UTC+1, Ricardo Barbosa escreveu:
>>
>>
>> I think this use case might have happened to someone else and maybe it's
>> important for future reference, anyone can help?
>>
>> Thanks
>>
>> Quarta-feira, 21 de Maio de 2014 19:31:13 UTC+1, Ricardo Barbosa escreveu:
>>>
>>> Hi there,
>>>
>>> Today I've added a manytomanyfield (facilites) and the widget doesn't
>>> appear on the admin, any pointers?
>>>
>>> #models.py
>>> class Room(Orderable):
>>> parent = models.ForeignKey("Property")
>>> name = models.CharField(max_length=32)
>>> lotation = models.IntegerField(default=1,help_text="")
>>> facilities = models.ManyToManyField("Facility")
>>>
>>> def __str__(self):
>>> return "%s -> %s" % (self.parent.name,self.name)
>>>
>>> class Property(SiteRelated):
>>> class Meta:
>>> verbose_name_plural = "properties"
>>> name = models.CharField(max_length=32,unique=True,help_text="Has to
>>> be uniqure")
>>> location = models.ForeignKey("Location")
>>>
>>> #admin.py
>>> class RoomInline(TabularDynamicInlineAdmin):
>>> model = Room
>>>
>>> class PropertyAdmin(admin.ModelAdmin):
>>> inlines = (RoomInline,)
>>>
>>> admin.site.register(Property,PropertyAdmin)
>>>
>>> Thank You!
>>>
>>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.