Àå°í - ¹®¼Django ¸ðµ¨¿¡ ¹®¼ ÷ºÎ | |
Áö±Ý ´Ù¿î·Îµå |
Àå°í - ¹®¼ ¼øÀ§ ¹× ¿ä¾à
±¤°í
- ƯÇã:
- MIT/X Consortium Lic...
- °¡°Ý:
- FREE
- °Ô½ÃÀÚ À̸§:
- James Pic
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- https://github.com/jpic/
Àå°í - ¹®¼ ű×
Àå°í - ¹®¼ ¼³¸í
Django-Documents´Â ´ÙÀ½À» Á¦°øÇÏ´Â °£´ÜÇÑ Django ¾ÛÀÔ´Ï´Ù. - ´ÙÀ½°ú °°Àº ¹®¼ ¸ðµ¨ÀÔ´Ï´Ù. - °³ÀÎ µð·ºÅ丮¿¡ ¾÷·ÎµåÇÏ´Â ÆÄÀÏ Çʵå - get_download_url () - »ç¿ëÀÚ Á¤ÀǸ¦ Çã¿ëÇÏ´Â ¹®¼¸¦ ´Ù¿î·ÎµåÇϴº¸±â º¸¾ÈÀº ´Ù¿î·Îµåº¸±â¿¡ ÀÇÇØ ¹æÃâµÇ´Â ½ÅÈ£, document_pre_download, ½ÅÈ£¸¦ ¹æÃâÇÏ´Â °æ¿ì 503À¸·Î ÀÀ´äÇÏ´Â 503À¸·Î ÀÀ´äÇÕ´Ï´Ù. ¼³Ä¡ ¹®¼´Â "¼³Ä¡"¹× "Django ÇÁ·ÎÁ§Æ®¿¡ Ãß°¡"¸¦ ¼öÇàÇÕ´Ï´Ù. AutoComplete_LightRefer Django-AutoComplete-Light ¼³Ä¡ ¹®¼¿¡ "ºü¸¥ ¼³Ä¡"¹× "ºü¸¥ °ü¸® ÅëÇÕ"À» ¼öÇàÇϽʽÿÀ. Django-DocumentsDownload ÃֽŠ¸±¸®½º : PIP ¼³Ä¡ Django -documentsor °³¹ß ¹öÀü ¼³Ä¡ : PIP ¼³Ä¡ - GIT + https : //github.com/yourlabs/django-documents.git#egg=documents.gegg=documentsadd to settings.installed_apps : '¹®¼', ³²ÂÊÀ» »ç¿ëÇÏ´Â °æ¿ì ½ÇÇà : ./ manage.py migrateElse, ½ÇÇà : ./ manage.py syncdbadd urls.py:ural ( '^documents/', include ( 'documents.urls')), settings.documents_upload_to¸¦ Àý´ë °æ·Î·Î ¼³Á¤ÇϽʽÿÀ. ¾÷·Îµå°¡ ÀúÀåµÇ¾î¾ßÇÏ´Â °÷. ÀÌ°ÍÀº °³ÀÎ µð·ºÅ丮À̾î¾ßÇÕ´Ï´Ù. ÀÏ¹Ý ÀÚµ¿ ¿Ï¼º µîÀÇ ÀϹÝÀûÀÎ ÀÚµ¿ ¿Ï¼º µîÀ» "AutoCompleTeDocumentRelations"¶ó´Â À̸§À¸·Î ³ªÅ¸³À´Ï´Ù. urls.py¿¡¼ °¡Á®¿Â test_projectÀÇ ¿¹Á¦°¡ ÀÖ½À´Ï´Ù. Django-autocomplete-light ¹®¼¸¦ ´ëü ¹æ¹ý¿¡ ´ëÇÑ ·¹Áö½ºÆ®¸®¿¡ ´ëÇØ ÂüÁ¶ÇϽʽÿÀ. ÇÁ·ÎÁ§Æ®°¡ ÀÌ¹Ì Django-generic-m2m ¹× django-autocomplete-light¸¦ »ç¿ëÇÏ´Â °æ¿ì ÁÁÀº ÇØ°áÃ¥Àº ÇÁ·ÎÁ§Æ®ÀÇ ÀÏ¹Ý ÀÚµ¿ ¿Ï¼ºÀ» ´Ù½Ã µî·ÏÇÏ´Â °Í = 'autocompleteDocumentRelations'·Î ÇÁ·ÎÁ§Æ®ÀÇ ÀÏ¹Ý ÀÚµ¿ ¿Ï¼ºÀ» ´Ù½Ã µî·ÏÇÏ´Â °ÍÀÔ´Ï´Ù. , Áï ÇÁ·ÎÁ§Æ® ƯÁ¤ autochompleteClass autoCompleteProject (autochomplete_light.autocompletegenericbase) : # .... ÇÁ·ÎÁ§Æ®¿¡ ´ëÇÑ ·¹Áö½ºÅÍ NewsautoComplete_light.Register (AutoCompleteProject) # registery for DocumentsautoComplete_light.Register (autocompleteProject, name = 'autocompleteedocumentRelations') documents_pre_import to document_pre_import, ¿¹ : # ÇÁ·ÎÁ§Æ® ƯÁ¤ ¹®¼ permissionsImport documentsdef document_security (kwargs) : frembet.user.is_staff : Documents.DownloadFord () document.document_pre_download.connect (document_security) ¹®¼ Ç¥½Ã Python¿¡¼ modeluse get_related_documents ()¿Í °ü·ÃµÈ : documents.mode¿¡¼ ls get_related_documentsyour_model = yourmodel.objectss.get (pk = xxx) = get_related_documents (your_model) ¶Ç´Â ÅÛÇø´¿¡¼ : {% load documents_tags %} {% load_tags %} {{document}} {% endfor % } get_related_documents ()´Â queryset, Áï querysetÀ» ¸®ÅÏÇÕ´Ï´Ù. count : get_related_documents (your_model) .count () ¶Ç´Â ÅÛÇø´¿¡¼ : {% with view_documents = your_model | get_related_documents %} {{relative_documents.count}} {% endwith %} Á¦Ç°ÀÇ È¨ÆäÀÌÁö
Àå°í - ¹®¼ °ü·Ã ¼ÒÇÁÆ®¿þ¾î