django - how to get access to the django class object
问题描述
I have created a model class in django
class metaTag(models.Model):
page_choice=[
('index','index'),
('about','about'),
('carrer','carrer'),
('base','base'),
('checkup','checkup'),
('contact','contact'),
('faq','faq'),
('checkup','checkup'),
('app','app'),
('googleads','googleads'),
('graphics','graphics'),
('seo','seo'),
('socialmedia','socialmedia'),
('web','web'),
]
page=models.CharField(max_length=15,choices=page_choice,default='index')
title=models.CharField(max_length=50,default="AdsOptimiser")
description=models.CharField(max_length=160,default="AdsOptimiser")
keywords=models.CharField(max_length=200,default="AdsOptimiser")
def __str__(self):
return self.page
what I want to achive by this I want my client have an option to change the title keywords and description meta tags from its admin panel to achive this I created this class so the client can fill the data now i am confused how to plug in the data and what will be the optimal way to do it.
解决方案
推荐阅读
- google-cloud-platform - google bigquery 基于表格列的个性化警报
- python-3.x - 在 MacOS Mojave 上,python 版本 3.8.8 的 pyenv 安装失败
- javascript - 在频道中提问,保存答案,并根据该答案做某事,discord.js
- java - 试图乘以 0.10 到我输入的任何输入。另外对于我的扫描仪“资源”说它从未关闭
- html - 在客户项目中,我必须指定我自己还是客户?
- docker - docker创建容器以放弃对其他主机文件数据的访问的机制是什么?
- python - 如何从其他对象访问一个对象
- android - Flutter:如何从 JSON 创建收藏夹列表
- php - Woocommerce - 变体名称
- javascript - 在 Javascript 中处理嵌套 API