«前の日記(2008-05-13) 最新 次の日記(2008-05-15)» 編集

ToDo:

  • 99 深呼吸して、おちけつ (~12/31 あと256日)
  • 98 毎日アウトプットを重きにおいた目標をたてる (~12/31 あと256日)
  • 97 買物は行動を変えるもの・ことに限る (~12/31 あと256日)
  • 96 合理的な行動はときに我慢を強いる(~12/31 あと256日)

ɥozɐʞıɥ


2008-05-14 ちょっと色々試しています [長年日記]

_ [Web][Python][GAE] Google App Engine ヲレアプリ

DELETEを全く実装しておりませんが、とりあえず公開。 うーむー… いちをー、jQueryのお勉強(あんまりなっていませんが)も入れました。 static_dir使ってJavaScriptも入れました。(WindowsのSDKバグっていたのですが、1.0.1で修正されていましたね。)
 application: hikazou
 version: 1
 runtime: python
 api_version: 1
 
 handlers:
 - url: /js
  static_dir: js
 
 - url: /js/(.*\.js)
  static_files: js/\1
  upload: js/(.*\.js)
 
 - url: /.*
  script: main.py
 
index.htmlは…(お恥ずかしいのですが、まずは晒す)
<html>
  <head>
  <script language="javascript" type="text/javascript" src="/js/jquery.js"> 
    <!--
      -->
  </script>
  <title>test</title>
  </head>
  <body>
    <form action="/delete" method="post" onsumit="return checkMark();">
    <table border="1" id="table_1">
    <tr>
      <th>チェック</th>
      <th>タイトル</th>
      <th>著者</th>
      <th>価格</th>
      <th>書店</th>
      <th>場所</th>
    </tr>
    {% for purchase in purchase_list %}
    <tr>
    <td><input id="{{ purchase.key }}" type="radio" /></td>
    <td id="title_{{ purchase.key }}" >{{ purchase.book.title|escape }}</td>
    <td id="author_{{ purchase.key }}">{{ purchase.book.author|escape }}</td>
    <td id="price_{{ purchase.key }}">{{ purchase.book.price|escape }}</td>
    <td id="name_{{ purchase.key }}">{{ purchase.shop.name|escape }}</td>
    <td id="place_{{ purchase.key }}">{{ purchase.shop.place|escape }}</td>
    </tr>
    {% endfor %}
  </table>
    <input type="submit" name="delete" value="Delete" />
  </form>
    <form action="/entry" method="post" onsubmit="return checkSubmit();">
    </table>
	<lable>タイトル:<input type="text" name="title" id="title"/></label>
        <label>著者:<input type="text" name="author" id="author"/></label>
        <label>価格:<input type="text" name="price" id="price"/></label>
        <label>書店:<input type="name" name="name" id="name"/></label>
        <label>場所:<input type="place" name="place" id="place"/></label>
        <input type="submit" name="OK" id="OK_button"/>
    </form>
  </body>
  <script language="javascript" type="text/javascript">
    <!--
      var before_checked = null;
      $(':radio').click(function(){
        if ( this == before_checked ) return ;
        this.checked = true;
        if ( before_checked != null){
          before_checked.checked = false;
        }
        before_checked = this;
        $('#title').val($('#title_' + $(this).attr('id')).text());
        $('#author').val($('#author_' + $(this).attr('id')).text());
        $('#price').val($("#price_" + $(this).attr('id')).text());
        $('#name').val($("#name_" + $(this).attr('id')).text());
        $('#place').val($("#place_" + $(this).attr('id')).text());
      }
      );
      $('#price').change(function(){
	if (isNaN($('#price').val())){
	alert('you need numeric parameter');
	}
      });
      function checkMark(){
      }
      function checkSubmit(){
	if (isNaN($('#price').val())){
	alert('you need numeric parameter');
        return false;
	}
      return true;
      }
      -->
  </script>
</html>


2002|09|10|11|12|
2003|01|02|03|04|05|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|01|02|03|
«前の日記(2008-05-13) 最新 次の日記(2008-05-15)» 編集