Django-polymorphic-tree.

³ª¹«¿¡ ³»¿ëÀ» Ç¥½ÃÇÏ´Â ´ÙÇü¼º MPTT ±¸Á¶
Áö±Ý ´Ù¿î·Îµå

Django-polymorphic-tree. ¼øÀ§ ¹× ¿ä¾à

±¤°í

  • Rating:
  • ƯÇã:
  • The Apache License 2.0
  • °¡°Ý:
  • FREE
  • °Ô½ÃÀÚ À̸§:
  • Diederik van der Boor
  • °Ô½ÃÀÚ À¥»çÀÌÆ®:
  • https://github.com/edoburu/

Django-polymorphic-tree. ű×


Django-polymorphic-tree. ¼³¸í

Django-polymorphic-tree´Â ½ºÅĵå È¥ÀÚ ¸ðµâÀÔ´Ï´Ù. - "Æ®¸®ÀÇ ÄÜÅÙÃ÷¸¦ Ç¥½ÃÇÏ´Â ´ÙÇü¼º ±¸Á¶."Áï,ÀÌ ¸ðµâÀº °¢ ³ëµå°¡ ´Ù¸¥ ¸ðµ¨ À¯Çü ÀÏ ¼öÀÖ´Â ³ëµå Æ®¸®¸¦ Á¦°øÇÕ´Ï´Ù. ÀÌ·¸°ÔÇϸé Æ®¸® µ¥ÀÌÅ͸¦ ÀÚÀ¯·Ó°Ô ±¸Á¶È­ ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿¹ : - ·çÆ® ³ëµå, ¹üÁÖ ³ëµå, ¸®ÇÁ ³ëµå, »ç¿ëÀÚ Á¤ÀÇ Çʵå¿Í ÇÔ²² Æ®¸®¸¦ ºôµåÇÕ´Ï´Ù. - ÇÁ·ÎÁ§Æ®, ¹üÁÖ ¹× Ç׸ñÀÇ todo ¸ñ·ÏÀ» ºôµåÇÕ´Ï´Ù .- Àå, ¼½¼Ç ¹× pagesÀÇ Ã¥À» ºôµåÇÕ´Ï´Ù .Originthis ¸ðµâÀº ÀϹÝÀûÀÎ ¸ñÀûÀ» À§ÇØ ¹àÇô Á³±â ¶§¹®¿¡ Àå°í À¯Ã¢ÇÑ ÆäÀÌÁö¿¡¼­ ¹þ¾î³µ½À´Ï´Ù. ÀÌ°ÍÀº Leukeleu¿¡¼­ (Django-fiberÀÇ Âü¿©·Î ¾Ë·ÁÁü)¿¡¼­ °è¾à ÀÛ¾÷ Áß¿¡ ¼öÇàµÇ¾ú½À´Ï´Ù. : //github.com/edoburu/django-polymorphic-tree.git#egg=django-polymorphic-treethe ÁÖ¿ä Á¾¼Ó¼ºÀº ÀÚµ¿À¸·Î ¼³Ä¡ µÉ DJango-MPTT ¹× Django-polymorphicÀ̸ç, ÀÚµ¿ ¼³Ä¡µË´Ï´Ù. ÄÁÇø®ÄÉÀ̼ÇÀ» »ç¿ëÇÏ¿© ÀÀ¿ë ÇÁ·Î±×·¥À» »ç¿ëÇÏ´Â ÇÁ·ÎÁ§Æ® ¸¸µé±â : CD ..DJango-admin.py startproject demoadd to settings.py:installed_apps + = ( 'polymorphic_tree', 'polymorphic', 'mptt',)ÀÌ ¸ðµâÀÇ ÁÖ¿ä ±â´ÉÀº »ç¿ëÀÚ Á¤ÀÇ ³ëµå À¯ÇüÀÇ Æ®¸®¸¦ ÀÛ¼ºÇÏ´Â °ÍÀÔ´Ï´Ù. 2 °³ÀÇ ÆÄÀÏÀÌÀÖ´Â ÀÀ¿ë ÇÁ·Î±×·¥À» ¸¸µå´Â °ÍÀ¸·Î ²úÀ¸·Á¸é ¸ðµ¨ .py ÆÄÀÏÀº »ç¿ëÀÚ Á¤ÀÇ ³ëµå À¯ÇüÀ» Á¤ÀÇÇؾßÇÏ¸ç ´ÙÀ½ Çʵ带 Á¤ÀÇÇؾßÇÕ´Ï´Ù. Django.utils.Translation _From Polymorphic_tree.models import polymorphicmpttmodel import ugeText_lazy polymorphictreefoIgney # Æ®¸®ÀÇ ±âº» ¸ðµ¨ : Class Basetreenode (polymorphicmpttmodel) : parent = polymorphictreeforeignkey ( 'self', blank = true, null = true, reference_name = '¾î¸°ÀÌ', verbose_name = _ ( 'parent') Á¦¸ñ = ¸ðµ¨. charfield (_ ( "Á¦¸ñ"), max_length = 200) Ŭ·¡½º ¸ÞŸ : verbose_name = _ ( "Æ®¸® ³ëµå") verbose_name_plural = _ ( "Æ®¸® ³ëµå") # Æ®¸® ³ëµå¿¡ ´ëÇØ 3 °³ÀÇ ÆÄ»ý µÈ ¸ðµ¨ »ý¼º : Ŭ·¡½º Ä«Å×°í¸® ³ëµå (BasetreenOde) : open_title = models.charfield (_ ( "¿­±â Á¦¸ñ"), max_length = 200) Opening_Image = models.ImageField (_ ( "¿­±â À̹ÌÁö"), upload_to = 'À̹ÌÁö') Ŭ·¡½º ¸ÞŸ : verbose_name = _ ( "Ä«Å×°í¸® ³ëµå") verbose_name_plural = _ ( "¹üÁÖ ³ëµå") class textnode (basetreenode) : examble_text = models.textfield () # extra settin GS : CAN_HAVE_CHILDREN = FALS Ŭ·¡½º ¸ÞŸ : verbose_name = _ ( "ÅؽºÆ® ³ëµå") verbose_name_plural = _ ( "ÅؽºÆ® ³ëµå") Ŭ·¡½º Imagenode (BasetreenOde) : image = models.ImageField (_ ( "À̹ÌÁö"), upload_to = 'À̹ÌÁö' ) class meta : verbose_name = _ ( "À̹ÌÁö ³ëµå") verbose_name_plural = _ ( "À̹ÌÁö ³ëµå") admin.py ÆÄÀÏÀº ÀÚ½Ä ³ëµå ¹× »óÀ§¿¡ ´ëÇÑ adminÀ» Á¤ÀÇÇؾßÇÕ´Ï´Ù. django.contrib °¡Á® ¿À±â adminfrom django.utils¿¡¼­. ¹ø¿ª _from polymorphic_tree.admin °¡Á® ¿À±â polymorphicmpttparentmodeladmin, polymorphicmpttchildmodeLadminfromÀ¸·Î ugettext_lazy °¡Á® ¿À±â. °¡Á® ¿À±â ¸ðµ¨ # ¸ðµç ÆÄ»ý µÈ ¸ðµ¨ÀÇ °øÅë °ü¸® ±â´É : Class BaseChildAdmin (polymorphicmptchildmodeLadmin) : general_fieldset = (¾øÀ½, { 'Çʵå': ( 'ºÎ¸ð', 'Á¦¸ñ'),}) base_model = models.baseTreenode base_fieldsets = (general_fieldset, ) # ¼±ÅÃÀûÀ¸·Î ÀϺΠ»ç¿ëÀÚ Á¤ÀÇ °ü¸®ÀÚ ÄÚµå cordnodeadmin (BaseChildmin) : Æнº #ÀÌ ÆÄÀÏÀ» °áÇÕÇÑ »óÀ§ °ü¸®ÀÚ¸¦ ¸¸µì´Ï´Ù. treenodeParentAdmin (polymorphicmpttparentmodemin) : base_model = models.baseTreenode child_models = (models.categorynode, basechadmin), (models.textnode, textnodeadmin), # »ç¿ëÀÚ Á¤ÀÇ °ü¸®ÀÚ´Â »ç¿ëÀÚ Á¤ÀÇ °ü¸®ÀÚ¸¦ Çã¿ëÇÕ´Ï´Ù. admin.css ',)} admin.site.Register (models.baseReenode, treenodeParentAdmin) child_models ¼Ó¼ºÀº HTE ÆíÁý ¹× »èÁ¦ ÆäÀÌÁö¿¡ ´ëÇØ·Îµå µÈ °ü¸® ÀÎÅÍÆäÀ̽º¸¦ Á¤ÀÇÇÕ´Ï´Ù. ¸ñ·Ïº¸±â´Â ¿©ÀüÈ÷ »óÀ§ Admin.productÀÇ È¨ÆäÀÌÁö¿¡ ÀÇÇØ ·»´õ¸µµË´Ï´Ù.


Django-polymorphic-tree. °ü·Ã ¼ÒÇÁÆ®¿þ¾î

Django-comps.

FrontEnd µðÀÚÀ̳ʸ¦ Django Proj¿¡ ÅëÇÕÇϱâÀ§ÇÑ ÁøÀÔ Á¡À» Á¦°øÇÏ´Â °£´ÜÇÑ ÀÀ¿ë ÇÁ·Î±×·¥ ... ...

77

´Ù¿î·Îµå