04-20-2023 09:40 AM
Hi
I have created a custom model 'Document', and some custom type of 'Identity Document' and 'Passport Document'. I have a records Management Site, so when I try to add the Metadata to the document, according to the documention there is supposed to be a buton named "Add record Metadata", but in my Site it does not exist and I have Imported the 'DOD 5015 example data' as the data set. So how can I Add my Metadata.
04-21-2023 02:46 AM
Hello! To add metadata to a document in the Django admin panel, you need to create an admin class for the model and register it in the admin.py file. For example, if your Document model looks like this: python Copy code class Document(models.Model): name = models.CharField(max_length=200) file = models.FileField(upload_to='documents/') date_created = models.DateTimeField(auto_now_add=True) Then, to add metadata, you would create an admin class in admin.py like this: python Copy code from django.contrib import admin from .models import Document class DocumentAdmin(admin.ModelAdmin): list_display = ('name', 'file', 'date_created', 'metadata') search_fields = ('name',) admin.site.register(Document, DocumentAdmin) In this example, metadata is a field in the model that you're using to store metadata. When you go to the record management page for the Document model in the Django admin, you should see a button labeled "Add Record Metadata".
Explore our Alfresco products with the links below. Use labels to filter content by product module.