用于创建和管理句柄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上释放。



欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
如何使用运行时从JAVA运行openssl命令?   不使用线程安全类(如AtomicInteger和SynchronizedList)的java ProducerConsumer问题   匹配字符串的java模式   在java中使用泛型接口作为返回类型   java将可能具有序列化JSON值的hashmap作为节点添加到JSON字符串中   Eclipse无法从Java8流推断正确的类型   java无法了解标准JButton的大小   java我能用一个循环优化这个函数吗(在第一种方法中)?   Apache CXF中基于WebSocket的java SOAP?   java想要运行奇偶和求和三步   矩阵上随机元素的java集值   java布尔相等:0==a,操作数顺序重要吗?   java Eclipse不会退出我的插件   java如何在spring的SOAP拦截器中获取HttpServletRequest和HttpServletResponse