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

Cannot input seo data for model instances #5

Closed dzida closed 13 years ago

dzida commented 13 years ago

Hi again,

I have a problem with assigning seo data for model instances. I configured seo_models section in Meta of my MetaData class, but after this it is not possible to input seo data for instances of given models.

I expected to see (inline) form in edit page for certain model instance and I couldn't find it. Am I doing something wrong?

willhardy commented 13 years ago

You can edit the metadata in the admin by following the instructions in the documentation: http://readthedocs.org/docs/django-seo/en/latest/reference/definition.html#admin

Let me know if that makes sense, especially if you have any suggestions for improvement :-) Note that you currently can't specify a model in seo_models AND use an inline, as this will attempt to add metadata twice. Either use one or the other (adding the model to seo_models will automatically generate a metadata instance when saving your model instance).

dzida commented 13 years ago

Hi,

Yes, now it makes sense and evenmore, it works:)

My idea to improve this is to allow defining inlines in one place somehow, eg. in Meta of seo.Metadata as other options. It is a bit inconsistent to manage over seo configuration in Meta and in number of admin.py files. It would be great to have option like seo_model_instances_inlines where one could set up models for which instances should have inline form to define seo data (inline would be appended to proper ModelAdmin class). I haven't dig if there is a tehcnical possibility to accomplish this, just tried to share maybe a reckless idea:)

Regards, Lukasz

willhardy commented 13 years ago

That particular process wouldn't be entirely compatible with Django Admin: where the admin specification is separated from the model definition so you can eg have multiple admins etc (Django used to define the admin in the models, but separated it for the 1.0 release).

But you're right in that it would be nice to quickly setup all models of a given app to have metadata inlines. I'll have to check what's possible, but I imagine with a bit of trickery it could be done. I'll open a new ticket for it.

Thanks for your feedback!