teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

5

修正

2019/03/18 07:31

投稿

sequelanonymous
sequelanonymous

スコア123

title CHANGED
File without changes
body CHANGED
@@ -20,6 +20,8 @@
20
20
  ```python
21
21
  class TEST():
22
22
  def __init__(self, _id):
23
+ from logging import getLogger
24
+ logger = getLogger(__name__)
23
25
  logger.info("_id of this is %s", _id)
24
26
  self._id = _id
25
27
  ```
@@ -27,6 +29,8 @@
27
29
  ```python
28
30
  class TEST(object):
29
31
  def __init__(self, _id):
32
+ from logging import getLogger
33
+ logger = getLogger(__name__)
30
34
  logger.info("_id of this is %s", _id)
31
35
  self._id = _id
32
36
  ```
@@ -34,6 +38,8 @@
34
38
  ```python
35
39
  class TEST:
36
40
  def __init__(self, _id):
41
+ from logging import getLogger
42
+ logger = getLogger(__name__)
37
43
  logger.info("_id of this is %s", _id)
38
44
  self._id = _id
39
45
  ```

4

修正

2019/03/18 07:31

投稿

sequelanonymous
sequelanonymous

スコア123

title CHANGED
File without changes
body CHANGED
@@ -19,21 +19,21 @@
19
19
  ```
20
20
  ```python
21
21
  class TEST():
22
- def __init__(self, logger):
22
+ def __init__(self, _id):
23
23
  logger.info("_id of this is %s", _id)
24
24
  self._id = _id
25
25
  ```
26
26
 
27
27
  ```python
28
28
  class TEST(object):
29
- def __init__(self, logger):
29
+ def __init__(self, _id):
30
30
  logger.info("_id of this is %s", _id)
31
31
  self._id = _id
32
32
  ```
33
33
 
34
34
  ```python
35
35
  class TEST:
36
- def __init__(self, logger):
36
+ def __init__(self, _id):
37
37
  logger.info("_id of this is %s", _id)
38
38
  self._id = _id
39
39
  ```

3

2019/03/18 07:30

投稿

sequelanonymous
sequelanonymous

スコア123

title CHANGED
File without changes
body CHANGED
@@ -18,21 +18,21 @@
18
18
 
19
19
  ```
20
20
  ```python
21
- TEST():
21
+ class TEST():
22
22
  def __init__(self, logger):
23
23
  logger.info("_id of this is %s", _id)
24
24
  self._id = _id
25
25
  ```
26
26
 
27
27
  ```python
28
- TEST(object):
28
+ class TEST(object):
29
29
  def __init__(self, logger):
30
30
  logger.info("_id of this is %s", _id)
31
31
  self._id = _id
32
32
  ```
33
33
 
34
34
  ```python
35
- TEST:
35
+ class TEST:
36
36
  def __init__(self, logger):
37
37
  logger.info("_id of this is %s", _id)
38
38
  self._id = _id

2

追記

2019/03/18 07:20

投稿

sequelanonymous
sequelanonymous

スコア123

title CHANGED
File without changes
body CHANGED
@@ -7,8 +7,8 @@
7
7
 
8
8
  ```
9
9
 
10
-
10
+ 以下は、クラスを呼ぶ場所
11
- ```ここに言語を入力
11
+ ```python
12
12
  def _exec(request, _id):
13
13
  # こっちだとエラーはでない
14
14
  a_id = TEST()

1

追記

2019/03/18 07:05

投稿

sequelanonymous
sequelanonymous

スコア123

title CHANGED
File without changes
body CHANGED
@@ -7,6 +7,16 @@
7
7
 
8
8
  ```
9
9
 
10
+
11
+ ```ここに言語を入力
12
+ def _exec(request, _id):
13
+ # こっちだとエラーはでない
14
+ a_id = TEST()
15
+    # 以下だとエラーがでる
16
+ b_id = TEST(_id)
17
+
18
+
19
+ ```
10
20
  ```python
11
21
  TEST():
12
22
  def __init__(self, logger):