Skip to content

Commit 292ddc2

Browse files
be-haseokdtsk
authored andcommitted
Change 'postback.params' type from python object to dict. (line#64)
1 parent 9051c01 commit 292ddc2

File tree

2 files changed

+2
-38
lines changed

2 files changed

+2
-38
lines changed

models/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
PostbackEvent,
3232
BeaconEvent,
3333
Postback,
34-
Params,
3534
Beacon,
3635
)
3736
from .imagemap import ( # noqa

models/events.py

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -269,50 +269,15 @@ def __init__(self, data=None, params=None, **kwargs):
269269
"""__init__ method.
270270
271271
:param str data: Postback data
272-
:param params: JSON object with the date and time
272+
:param dict params: JSON object with the date and time
273273
selected by a user through a datetime picker action.
274274
Only returned for postback actions via the datetime picker.
275-
:type params: T <= :py:class:`linebot.models.events.Params`
276275
:param kwargs:
277276
"""
278277
super(Postback, self).__init__(**kwargs)
279278

280279
self.data = data
281-
self.params = self.get_or_new_from_json_dict(
282-
params, Params
283-
)
284-
285-
286-
class Params(Base):
287-
"""Params.
288-
289-
Object with the date and time selected by a user
290-
through a datetime picker action.
291-
The format for the full-date, time-hour, and time-minute
292-
as shown below follow the RFC3339 protocol.
293-
294-
https://devdocs.line.me/en/#postback-params-object
295-
"""
296-
297-
def __init__(self, date=None, time=None, datetime=None, **kwargs):
298-
"""__init__ method.
299-
300-
:param str date: Date selected by user.
301-
Only included in the date mode.
302-
Format: full-date
303-
:param str time: Time selected by the user.
304-
Only included in the time mode.
305-
Format: time-hour":"time-minute
306-
:param str datetime: Date and time selected by the user.
307-
Only included in the datetime mode.
308-
Format: full-date"T"time-hour":"time-minute
309-
:param kwargs:
310-
"""
311-
super(Params, self).__init__(**kwargs)
312-
313-
self.date = date
314-
self.time = time
315-
self.datetime = datetime
280+
self.params = params
316281

317282

318283
class Beacon(Base):

0 commit comments

Comments
 (0)