用于创建和管理句柄pids的django应用程序
acdh-django-handle的Python项目详细描述
======
ACDH Django句柄图片::https://badge.fury.io/py/acdh django-django-django-handle.svg
:target:https://badge.fury.io/py/acdh django-django-handle
>创建和管理handle-pids的django应用程序
quickstart
:将其添加到您的“已安装”的应用程序中,并将其添加到您的“已安装”的应用程序中:
<……代码块::python
已安装的应用程序=(
…
,‘handle’,
…
)
代码块::python
handle={
“解析器”:“http://hdl.handle.net”,
“用户”:“句柄提供程序用户”,
“pw”:“句柄提供程序密码”,
“url”:“句柄提供程序api的基url”,
“应用程序基本URL”:“应用程序的基本URL”
}
示例:
……代码块:Python
handle={
'resolver':“http://hdl.handle.net”,
'user':“user11.12345667-01”,
'pw':“password1234”,
'url':“http://pid.gwdg.de/handleds/11.12345667-01/”,
'app'u base'u-url':“http://pid.gwdg.de/handleds/11.12345667-01/”,
'app'u-base'u-url':“http://myproject.com”
>
并运行
---
包提供了一个管理命令,用于批量创建/注册句柄pids。为此,必须将“generirelation”属性添加到要为其注册句柄的模型类中,并确保定义了“get_absolute_url”方法。代码块::python
from django.contrib.contenttypes.fields import genericreation
from handle.models import pid
…
class example(models.model):
name=models.charfield(
max_length=255,blank=true,
)
…
pid=genericreation(pid,blank=true,null=true,related_query_name=“get_pid”)
…
def get_absolute_url(self):
return reverse('example_detail',kwargs={'pk':self.id})
to register/create handle pids run:
python manage.py crate_handles example
而不是“pid”,您需要将名称作为第二个参数传入,例如:
handle-pids将只为还没有handle-pid的对象装箱。
features
--
*提供存储
*handle-pid
*创建和修改日期
*与django项目的任何其他类的通用关系。
*一个过度隐藏的保存方法,它将在保存时注册/创建句柄PID,以防未提供句柄PID
*提供“handle.utils.create_handle”函数来注册/创建新句柄PID
*通过管理界面为项目中的任何对象注册/创建句柄PID。
*提供管理命令来批量创建/注册所有对象的句柄PID项目中模型类的实例。
代码块::控制台
tween upload dist/*
credits
----
>呈现此包时使用的工具:
*cookiecutter
*`cookiecutter djangopack`
。_ Cookiecutter:https://github.com/audreyr/Cookiecutter
。_` Cookiecutter djangopack`:https://github.com/pydanny/Cookiecutter djangopack
。_ HANDLE-PIDS:http://www.handle.net/
----
0.1.0(2018-06-28)
+++++++++++t在pypi上释放。
ACDH Django句柄图片::https://badge.fury.io/py/acdh django-django-django-handle.svg
:target:https://badge.fury.io/py/acdh django-django-handle
>创建和管理handle-pids的django应用程序
quickstart
:将其添加到您的“已安装”的应用程序中,并将其添加到您的“已安装”的应用程序中:
<……代码块::python
已安装的应用程序=(
…
,‘handle’,
…
)
代码块::python
handle={
“解析器”:“http://hdl.handle.net”,
“用户”:“句柄提供程序用户”,
“pw”:“句柄提供程序密码”,
“url”:“句柄提供程序api的基url”,
“应用程序基本URL”:“应用程序的基本URL”
}
示例:
……代码块:Python
handle={
'resolver':“http://hdl.handle.net”,
'user':“user11.12345667-01”,
'pw':“password1234”,
'url':“http://pid.gwdg.de/handleds/11.12345667-01/”,
'app'u base'u-url':“http://pid.gwdg.de/handleds/11.12345667-01/”,
'app'u-base'u-url':“http://myproject.com”
>
并运行
包提供了一个管理命令,用于批量创建/注册句柄pids。为此,必须将“generirelation”属性添加到要为其注册句柄的模型类中,并确保定义了“get_absolute_url”方法。代码块::python
from django.contrib.contenttypes.fields import genericreation
from handle.models import pid
…
class example(models.model):
name=models.charfield(
max_length=255,blank=true,
)
…
pid=genericreation(pid,blank=true,null=true,related_query_name=“get_pid”)
…
def get_absolute_url(self):
return reverse('example_detail',kwargs={'pk':self.id})
to register/create handle pids run:
python manage.py crate_handles example
而不是“pid”,您需要将名称作为第二个参数传入,例如:
handle-pids将只为还没有handle-pid的对象装箱。
features
--
*提供存储
*handle-pid
*创建和修改日期
*与django项目的任何其他类的通用关系。
*一个过度隐藏的保存方法,它将在保存时注册/创建句柄PID,以防未提供句柄PID
*提供“handle.utils.create_handle”函数来注册/创建新句柄PID
*通过管理界面为项目中的任何对象注册/创建句柄PID。
*提供管理命令来批量创建/注册所有对象的句柄PID项目中模型类的实例。
代码块::控制台
credits
----
>呈现此包时使用的工具:
*cookiecutter
*`cookiecutter djangopack`
。_ Cookiecutter:https://github.com/audreyr/Cookiecutter
。_` Cookiecutter djangopack`:https://github.com/pydanny/Cookiecutter djangopack
。_ HANDLE-PIDS:http://www.handle.net/
----
0.1.0(2018-06-28)
+++++++++++t在pypi上释放。