一个简单的django应用程序,用于向模型添加注释和相关操作。
django-comment的Python项目详细描述
##django comment
``django comment``是一个简单的django应用程序,可以为django模型添加注释。
这个项目的灵感来自[django taggit](https://github.com/alex/django-taggit),直接来自[django vote](https://github.com/shanbay/django vote)
[![构建状态](https://travis ci.org/shanbay/django comment.svg)(https://travis ci.org/shanbay/django comment)
[![codecov](https://codecov.io/gh/shanbay/django-comment/coverage.svg?branch=master)](https://codecov.io/gh/shanbay/django-comment?分支=主)
[![PYPI版本](https://badge.fury.io/py/django comment.svg)(https://badge.fury.io/py/django comment)
\fquick start
)
```
#### Add `CommentModel` to the model you want to comment
```python
from comment.models import CommentModel
class ArticleReview(CommentModel):
...
```
#### Run migrate
```shell
manage.py makemigrations
manage.py migrate
```
#### Use comment api
`` python
review=articlereview.objects.get(pk=1)
(BR/>)BR/>删除从对象'BR/>评论。获取(pk=注释tId)。user
review.comments.filter(user_id=user_id)
=评论。评论。创建(用户id,内容,创建时间=您的时间戳)
打印(com.created)您的时间戳
```
``django comment``是一个简单的django应用程序,可以为django模型添加注释。
这个项目的灵感来自[django taggit](https://github.com/alex/django-taggit),直接来自[django vote](https://github.com/shanbay/django vote)
[![构建状态](https://travis ci.org/shanbay/django comment.svg)(https://travis ci.org/shanbay/django comment)
[![codecov](https://codecov.io/gh/shanbay/django-comment/coverage.svg?branch=master)](https://codecov.io/gh/shanbay/django-comment?分支=主)
[![PYPI版本](https://badge.fury.io/py/django comment.svg)(https://badge.fury.io/py/django comment)
\fquick start
)
```
#### Add `CommentModel` to the model you want to comment
```python
from comment.models import CommentModel
class ArticleReview(CommentModel):
...
```
#### Run migrate
```shell
manage.py makemigrations
manage.py migrate
```
#### Use comment api
`` python
review=articlereview.objects.get(pk=1)
(BR/>)BR/>删除从对象'BR/>评论。获取(pk=注释tId)。user
review.comments.filter(user_id=user_id)
=评论。评论。创建(用户id,内容,创建时间=您的时间戳)
打印(com.created)您的时间戳
```