willhardy / django-seo

Provides a set of tools for managing Search Engine Optimisation (SEO) for Django sites.
BSD 3-Clause "New" or "Revised" License
251 stars 117 forks source link

get_inline() should return multiple inlines when Meta.use_sites or Meta.use_i18n are True #32

Open mandx opened 12 years ago

mandx commented 12 years ago

When defining a MySEOMetadata metadata model, if it's Meta.use_sites is set to True or it's Meta.use_i18n is set to True, then rollyourown.seo.admin.get_inline(SEOMetadata) should return an inline which allows for adding multiple items, so the webmaster can edit metadata for each site/language right in the item admin page.

In rollyourown.seo.admin, line 111 (as of v1.0, current Pypi's stable version), something like:

def get_inline(metadata_class):
    attrs = {
        'max_num': None if check_if_using_sites_or_i18n(metadata_class) else 1,
        'extra': 1,
        'model': metadata_class._meta.get_model('modelinstance'),
        'ct_field': "_content_type",
        'ct_fk_field': "_object_id",
        'formset': MetadataFormset,
        }
    return type('MetadataInline', (generic.GenericStackedInline,), attrs)
patxisan commented 9 years ago

+1 Completely agree. Indeed, it seems a contradiction that I can set different "metadata" by language, but then I can not allocate more than one, to each model instance.

Is there some kind of workaround to assign different "metatags" by language to each instance from the admin interface?

I take this opportunity to thank you for your work. It's really good!