Django-Ajax ÇÊÅ͸µ µÈ Çʵå

¸¹Àº »ç¶÷µéÀ»À§ÇÑ Django Çʵå Ajax ÇÊÅ͸µ µÈ °ü°è
Áö±Ý ´Ù¿î·Îµå

Django-Ajax ÇÊÅ͸µ µÈ ÇÊµå ¼øÀ§ ¹× ¿ä¾à

±¤°í

  • Rating:
  • ƯÇã:
  • MIT/X Consortium Lic...
  • °¡°Ý:
  • FREE
  • °Ô½ÃÀÚ À̸§:
  • Francesco Banconi
  • °Ô½ÃÀÚ À¥»çÀÌÆ®:
  • http://code.google.com/u/francesco.banconi/

Django-Ajax ÇÊÅ͸µ µÈ Çʵå ű×


Django-Ajax ÇÊÅ͸µ µÈ ÇÊµå ¼³¸í

¸¹Àº ¿Ü±¹ Å° ¾Æ¾à½º ÇÊÅ͸µ °ü°è¿¡ ¸¹Àº Àå°í Çʵå Àå°í - ¾Æ¾à½º ÇÊÅ͸µ Çʵå´Â »ç¿ëÀÚ°¡ Àֱ⠶§¹®¿¡ ±×µéÀº ³Ê¹« ¸¹Àº, ¾Æ´Ï¸é ±×³É »ç¿ë¼º ÀÌÀ¯°¡µÇ´Â, ³ª¿­µÈ °´Ã¼¿¡ ÇÊÅ͸¦ Àû¿ë ÇÒ ¼öÀÖ´Â ¸¹Àº ¿Ü±¹ Å° °ü°è¿¡ ¸¹Àº »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù Àå°í Çʵ尡 Æ÷ÇԵǾî ÀÖ½À´Ï´Ù. ¼±ÅÃµÈ ÇÊÅÍ¿¡ ´ëÇÑ »ç¿ëÀÚ Å¬¸¯ detailsWhen ±â¼úÀº Ajax ¿äûÀÌ Àü¼ÛµÈ´Ù. ±×°ÍÀº JSON Çü½ÄÀ¸·Î ÀÏÄ¡ÇÏ´Â ¿ä¼Ò¸¦ ¹ÝȯÇÕ´Ï´Ù. JQuery¿Í ÀÚ¹Ù ½ºÅ©¸³Æ® ¶óÀ̺귯¸®´Â ¹èÆ÷ÆÇ¿¡ Æ÷ÇÔ used.InstallationThe ajax_filtered_fields ÆÐÅ°Áö,ÀÇ´Â related_models ÇÊµå °æÀ¯ÇÏ¿© RelatedModel ÇÑ ¸¹Àº °ü°è·Î ¸¹ÀºÀÇ MyModel ¸ðµ¨À» ¸¸µé¾î º¸ÀÚ, ÆÄÀ̽ã path.UsageAs¿¡ »ç¿ë ¿¹Á¦¸¦ ¹èÄ¡ÇؾßÇÕ´Ï´Ù. ¹Ìµð¾î µð·ºÅ丮 ¹èÆ÷ ³» ¹Ìµð¾î / JS¿¡ ajax_filtered_fields.jsincluded ÀÚ¹Ù ½ºÅ©¸³Æ® ÆÄÀÏ / º¹»ç;¿¡¼­) '('ajax_filtered_fields.urls)¸¦ Æ÷ÇÔ 'Àå°í ÇÁ·ÎÁ§Æ®ÀÇ urls.py:(r'^ajax_filtered_fields/ÀÌ ÁÙÀ» Ãß°¡ °¡Á® ¿À±â ¼³Á¤ Ŭ·¡½º django.conf ajax_filtered_fields.forms¿¡¼­ °¡Á® AjaxManyToManyFieldfrom : ¸ðµ¨ ÇüÅ´ º¯ÀÌ selectfilter Çϳª·Î ¼±Åà À§Á¬ÀÌ ±× ÀÌÀü¿¡ º¹»ç µÈ ÀÚ¹Ù ½ºÅ©¸³Æ® ÆÄÀÏ, jQuery ¶óÀ̺귯¸®¿Í Àå°í °ü¸®ÀÚÀÇ ÀÚ¹Ù ½ºÅ©¸³Æ® Äڵ带 ÂüÁ¶, »ç¿ëÇÏ·Á´Â Çʵ带 ¼±Åà MyModelForm (forms.ModelForm) : # Á¶È¸¸¦ related_objects ¾Æ·¡¿¡ ¼³¸í = AjaxManyToManyField (RelatedModel, Á¶È¸) Ŭ·¡½º ¸ÞŸ : ¸ðµ¨ = ¸ðµ¨ Ŭ·¡½º ¹Ìµð¾î : JS = (settings.A DMIN_MEDIA_PREFIX´Â + "JS / SelectBox.js", settings.ADMIN_MEDIA_PREFIX + "JS / SelectFilter2.js ','/path/to/javascripts/jquery.js ','/path/to/javascripts/ajax_filtered_fields.js ')ÀÇ °æ¿ì {% ºÎÇÏ adminmediaÀÇ %} <½ºÅ©¸³Æ® À¯Çü = "ÅؽºÆ® ÀÚ¹Ù ½ºÅ©¸³Æ®"src = "¾ç½Ä °ü¸®ÀÚ Àå°í »ý¼º µÈ ÀÚµ¿Â÷ÀÇ »ç¿ë ¿ÜºÎµÇ°íÀÖ´Â ´ç½ÅÀº Çʵ尡 Ç¥½ÃµË´Ï´Ù ÆäÀÌÁö¿¡¼­ ¿©·¯ Àå°í °ü¸®ÀÚÀÇ ÀÚ¹Ù ½ºÅ©¸³Æ® ÆÄÀϷεåÇØ¾ß °ü¸® jsi18n "/>

°ü·Ã ¼ÒÇÁÆ®¿þ¾î