Implemented most of the api placeholders #23

Merged
LazIvanS merged 7 commits from feat_9.functional_api into develop 2021-04-28 23:02:43 +03:00
4 changed files with 286 additions and 73 deletions
Showing only changes of commit b2b447e392 - Show all commits

View File

@@ -13,10 +13,10 @@ API_TODO_ITEMS_DELETE = "api/todo_items/{0}/"
API_LISTS_LIST = "api/lists/"
API_LISTS_CREATE = "api/lists/"
API_LISTS_READ = "lists/{0}/"
API_LISTS_UPDATE = "lists/{0}/"
API_LISTS_PARTIAL_UPDATE = "lists/{0}/"
API_LISTS_DELETE = "lists/{0}/"
API_LISTS_READ = "api/lists/{0}/"
API_LISTS_UPDATE = "api/lists/{0}/"
API_LISTS_PARTIAL_UPDATE = "api/lists/{0}/"
API_LISTS_DELETE = "api/lists/{0}/"
API_TOKEN = "api/token/"
@@ -102,6 +102,43 @@ class UserApi(object):
)
)
def lists_delete(self, id):
"""
Auth required
Deletes a to-do list by id
Parameters
----------
id: to-do list id to delete
"""
return UserApi._raise_or_return_(
requests.delete(
url=self.get_api(API_LISTS_DELETE.format(id)),
headers=self._access_token_(),
)
)
def lists_update(self, title, id):
"""
Rename a new to-do list
Auth required
Parameters
----------
title : str
New name for a list.
id : int
"""
return UserApi._raise_or_return_(
requests.put(
url=self.get_api(API_LISTS_UPDATE.format(id)),
json={"title": title},
headers=self._access_token_(),
)
)
def todo_items_list(self, **argv):
"""
List all the exsiting to-do items.
@@ -119,6 +156,67 @@ class UserApi(object):
)
)
def todo_items_create(self, parent, text="Note"):
"""
Create a new to-do item
Auth required
Parameters
----------
parent : id of parent list
text : str, optional
New note. The default is "Note".
"""
return UserApi._raise_or_return_(
requests.post(
url=self.get_api(API_TODO_ITEMS_CREATE),
json={"text": text, "parent":parent, "finished":False},
headers=self._access_token_(),
)
)
def todo_items_delete(self, id):
"""
Auth required
Deletes a to-do item by id
Parameters
----------
id: to-do item id to delete
"""
return UserApi._raise_or_return_(
requests.delete(
url=self.get_api(API_TODO_ITEMS_DELETE.format(id)),
headers=self._access_token_(),
)
)
def todo_items_update(self, id, text, finished, parent):
"""
Rename a new to-do list
Auth required
Parameters
----------
id : int
Note id
text : str
New note for the item.
finished : bool
New state for the item
parent : int
Parent list id
"""
return UserApi._raise_or_return_(
requests.put(
url=self.get_api(API_TODO_ITEMS_UPDATE.format(id)),
json={"text": text, "finished":finished, "parent":parent},
headers=self._access_token_(),
)
)
# def create(self, title="Untitled"):
# """
# Create a new to-do list
@@ -215,4 +313,7 @@ class UserApi(object):
@staticmethod
def _raise_or_return_(response):
response.raise_for_status()
try:
return response.json()
except:
return response.content

View File

@@ -1,9 +1,10 @@
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
import numpy as np
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
from user import User
def print_lists(lists):
for item in lists:
print(f"List: '{item}'", f"Id: {item.id}", "|", "|".join([str(x) for x in item.items]))
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print(f"List: '{item.title}'", f"Id: {item.id}", "|", "|".join([str(x) for x in item.items_]))
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
DEFAULT_URL = "http://127.0.0.1:8000"
@@ -12,37 +13,35 @@ user = User(url=DEFAULT_URL)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
user.auth("root", "root")
AlekseyLobanov commented 2021-04-26 23:53:55 +03:00 (Migrated from github.com)
Review
user.lists_[0].modify(title=f"A new title {random.random()}")
```suggestion user.lists_[0].modify(title=f"A new title {random.random()}") ```
# Fetch existing lists:
lists = user.fetchUserLists()
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print("Fecthing...")
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(lists)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
# Remove user list by id:
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
user.removeUserList(5)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
lists = user.fetchUserLists()
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print(f"Removing {5}...")
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(lists)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(user.fetchUserLists())
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
# Append a new list to user:
print("Appending list...")
scroll = user.appendUserList(title="a new list!")
print_lists(lists)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(user.fetchUserLists())
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
# Remove user list by id:
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
i = user.lists_[0].id
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print(f"Removing {i}...")
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
user.removeUserList(i)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(user.fetchUserLists())
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
# Modify list 0:
print("Modifyng list...")
lists[0].modify(title="A new title")
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(lists)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
user.lists_[0].modify(title=f"A new title {np.random.random()}")
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(user.fetchUserLists())
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
# Append item to list:
print("Appending item to last list...")
item = lists[-1].append(text="this is an item")
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(lists)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
item = user.lists_[-1].append(text="this is an item")
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(user.fetchUserLists())
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
# Modifying item
print("Modifyng appended item...")
item.modify(finished=True, text="this is an updated item")
print_lists(lists)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(user.fetchUserLists())
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
# Removing item at 0
print("Removing item 0 from list 0...")
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
lists[0].remove(0)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(lists)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print("Removing last item from last list...")
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
user.lists_[-1].remove(-1)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(user.fetchUserLists())
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада

View File

@@ -1,85 +1,135 @@
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
import os
from types import SimpleNamespace
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
from datetime import datetime
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
import numpy as np
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
from api import UserApi
LIST_UPDATEBLE = ["title"]
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
TODO_ITEM_UPDATEBLE = ["text", "finished"]
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
UPDATE_ERROR = "Failed to update property: {0}"
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
DATETIME_STR = "%Y-%m-%dT%H:%M:%S.%fZ"
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def bad_arguments(x, d):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return list((set(x) - set(d)))
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
class ToDoList(object):
def __init__(self, id, title, created_at=None, items=[], parent=None):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def __init__(self, id, title, created_at=None, items=None,
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
parent=None, user=None):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.id = id
self.title = title
self.items = items
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.items_ = [] if items is None else items
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
if type(created_at) is datetime:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.created_at = created_at
else:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.created_at = datetime.strptime(created_at, DATETIME_STR)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.user = user
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def __iter__(self):
for item in self.items:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
for item in self.items_:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
yield item
def __getitem__(self, index):
return self.items[index]
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return self.items_[index]
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def __len__(self):
return len(self.items)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return len(self.items_)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def __str__(self):
return f"[{self.id}] {self.title}"
def index(self, value):
return self.items.index(value)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return self.items_.index(value)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
# ToDo
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def remove(self, index):
self.items.remove(self.items[index])
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.sync()
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
"""
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
Remove item at index from db
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
"""
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
item = self.items_[index]
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.items_.remove(item)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
item.dispose()
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
# ToDo
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def append(self, text):
item = ToDoItem(id=None, text=text, created_at=datetime.now())
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.items.append(item)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
item.sync()
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.sync()
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return item
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
"""
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
Add a new item to db
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
"""
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
if "DEBUG" in os.environ:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
created_item = ToDoItem(id=np.random.randint(100, 1000), text=text, user=self.user)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
else:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
created_item = self.user.todo_items_create(parent=self.id, text=text)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
created_item = ToDoItem(**created_item, user=self.user)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.items_.append(created_item)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return created_item
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def modify(self, **argv):
bad = bad_arguments(argv.keys(), LIST_UPDATEBLE)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
if len(bad) > 0:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
raise RuntimeError(UPDATE_ERROR.format(bad[0]))
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
for key, value in argv.items():
setattr(self, key, value)
self.sync()
# ToDo
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def dispose(self):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
print(f"To-do list id '{self.id}' is being disposed of...")
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
if "DEBUG" in os.environ:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
for item in self.items_:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
item.dispose()
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.user.lists_delete(self.id)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def sync(self):
# ToDo send request or store in form
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
print(f"Item '{self}' is being synchronized...")
if "DEBUG" in os.environ:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.user.lists_update(title=self.title, id=self.id)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
class ToDoItem(object):
def __init__(self, id, text, finished=False, created_at=None, parent=None):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def __init__(self, id, text, finished=False, created_at=None,
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
parent=None, user=None):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.id = id
self.text = text
self.finished = finished
if type(created_at) is datetime:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.created_at = created_at
else:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.created_at = datetime.strptime(created_at, DATETIME_STR)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.parent = parent
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.user = user
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def __str__(self):
return f"[{self.id}] {self.text}"
def modify(self, **argv):
bad = bad_arguments(argv.keys(), TODO_ITEM_UPDATEBLE)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
if len(bad) > 0:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
print(argv)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
raise RuntimeError(UPDATE_ERROR.format(bad[0]))
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
for key, value in argv.items():
setattr(self, key, value)
self.sync()
# ToDo
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def sync(self):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
# ToDo send request or store in form
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
print(f"Item '{self}' is being synchronized...")
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
class User(UserApi):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def auth(self, user, passwd):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def dispose(self):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
print(f"To-do item id '{self.id}' is being disposed of...")
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
if "DEBUG" in os.environ:
return
UserApi.auth(self, user, passwd)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.user.todo_items_delete(self.id)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
# ToDo
items = [
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def sync(self):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
print(f"Item '{self}' is being synchronized...")
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
if "DEBUG" in os.environ:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.user.todo_items_update(id=self.id, text=self.text, finished=self.finished, parent=self.parent)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def make_debug_lists():
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return [
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
ToDoList(
id=i,
title=f"List {i}",
@@ -92,17 +142,63 @@ class User(UserApi):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
for i in range(10)
]
# ToDo
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
class User(UserApi):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def auth(self, user, passwd):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
"""
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
Basic authentification
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
"""
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
if "DEBUG" in os.environ:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
UserApi.auth(self, user, passwd)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
# Storing lists - mostly for debug purposes
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
lists_ = make_debug_lists()
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def fetchUserLists(self):
return self.items
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
"""
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
Fetch existing user lists from the server
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
returns: fetched list of ToDoList sorted by creation datetime
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
"""
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
print("Fetching lists...")
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
if "DEBUG" in os.environ:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return self.lists_
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
user_lists = self.lists_list()["results"]
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
user_items = self.todo_items_list()["results"]
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
toDoLists = {x["id"]:ToDoList(**x, user=self) for x in user_lists}
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
toDoItems = [ToDoItem(**x, user=self) for x in user_items]
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
for toDoItem in toDoItems:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
# Catching stray items
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
if not hasattr(toDoItem, "parent"):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
toDoItem.dispose()
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
continue
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
toDoLists[toDoItem.parent].items_.append(toDoItem)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
for toDoList in toDoLists.values():
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
toDoList.items_ = sorted(toDoList.items_, key=lambda x: x.created_at)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.lists_ = sorted(toDoLists.values(), key=lambda x: x.created_at)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return self.lists_
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
# ToDo
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def removeUserList(self, id):
self.items = [item for item in self.items if item.id != id]
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
"""
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
Remove existing user to-do list from the serverreturns:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
"""
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
to_remove = [item for item in self.lists_ if item.id == id][0]
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.lists_.remove(to_remove)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
if not ("DEBUG" in os.environ):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
to_remove.dispose()
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return self.lists_
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
# ToDo
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
def appendUserList(self, title):
item = ToDoList(id=None, title=title, created_at=datetime.now())
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.items.append(item)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
item.sync()
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
"""
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
Create a new user list
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
title: title of list to create
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
returns: created item
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
"""
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
if "DEBUG" in os.environ:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
item = ToDoList(id=np.random.randint(100, 1000), title=title, created_at=datetime.now())
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
self.lists_.append(item)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return item
created_list = self.lists_create(title=title)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
created_list = ToDoList(**created_list)
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return created_list
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print

View File

@@ -123,10 +123,10 @@ class WorkSpaceFrame(tk.Frame):
# data
self.lists = user.fetchUserLists()
text = tk.Text(self, width=15, height=1)
text.pack(anchor="sw")
self.add_list_text = tk.Text(self, width=15, height=1)
self.add_list_text.pack(anchor="sw")
add = tk.Button(self, text="Добавить лист", command=placeholder)
add = tk.Button(self, text="Добавить лист", command=self.add_list)
add.pack(anchor="sw")
# select list box
@@ -153,6 +153,23 @@ class WorkSpaceFrame(tk.Frame):
self.toToList = ToDoListWidget(self)
self.toToList.pack(side="left", fill="both", expand=1)
def add_list(self, *args):
text = self.add_list_text.get(1.0, "end").strip()
if len(text) == 0:
print("empty name! Not adding!")
return
self.user.appendUserList(title=text)
self.lists = self.user.fetchUserLists()
# fill list box
self.listBox.delete(0,'end')
for item in self.lists:
s = f"{str(item)}: {item.created_at.strftime('%Y-%m-%d %H:%M:%S')}"
self.listBox.insert(tk.END, s)
self.listBox.pack()
len(self.lists) > 0 and self.listBox.selection_set(first=0)
def listBox_selected(self, *args):
self.toToList.clear()