Skip to main content
  • Home
  • Drupal 教學
  • Portfolio
  • inmediahk.net
  • Training
  • About
Home

modelform

Django 可選 checkbox 的正確設定方式

-
Free tags: 
django
checkbox
modelform
JOE — Mon, 2012-07-16 23:45


使用 Modelform 的話,建立一個可選的 checkbox 還真要小心
例如 opt-in 類,“Check the box if you do not want to be contacted by us"
Model:

#model.py
class UserProfile(models.Model):
    opt_in = models.BooleanField()

ModelForm:

  • Read more about Django 可選 checkbox 的正確設定方式
  • Comments

Related

  • Drupal 教學
  • Drupal Theming, 模版
  • Drupal 開發
  • Drupal, javascript 和jquery
  • 3. Drupal views theming 自定 views 模版教學(一)
Google

Recent Comments

Contributions

  • Moved imagefield cropping info into a ta...
  • Contribute Documentation: migrate module...
  • My two bits on Drupal Migrate user pictu...
  • Taking up imagefield_crop module as main...
  • Trying to help imagefield_crop module 7....
  • My little thoughts on features version u...
  • Feeds importer for formatted_numbers mod...
  • Feeds module 6.x, supports import UTF-8...
  • Updating views fields changes field alia...
  • [Contribution to module] CCK table field
  • [Contribution to Doc] Generate SSH keys...
  • [Contribution to Doc] Webform confirmati...
  • [Contributions to Drupal core] system_ip...
Subscribe to modelform

Languages

  • 繁體中文
  • English

導覽

  • Drupal 教學
  • 建站軟件
  • 基礎概念(08年3月更新)
  • cck(08年3月更新)
  • views
  • 改變顯示node 的方法

ABOUT ME

I am Joe, Director of http://www.documentonready.com
An professional consultant focus in
Drupal, develop modules, sites,
projects.
Subscribe

More

Recent content

  • Git push over proxy temperately
  • Bangkok chatuchak lockers
  • Rsync git diff files to external
  • Alter comments query to order by DESC
  • Adding open graph tags to node page
  • Moved imagefield cropping info into a ta...
  • Alter user profile page password fields...
  • Drupal commerce - Add to cart anonymousl...
  • Create Drupal commerce order programatic...
  • Drupal feeds module: FeedsProcessor with...
  • Audi Home of Quattro technical review
  • Hennessy Artistry 2013 technical review
  • Web dev's dilemma: integration reso...
  • Audi A3 Facebook app
  • Git autocomplete on Mac
  •  
  • 1 of 23
  • next ›