-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial work on dynamic table row addition #29
Conversation
src/widgetastic/widget.py
Outdated
def row_count(self): | ||
return len(self) | ||
|
||
def add_row_handler(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will handle adding new rows. Will be overridden by the specific implementation.
I haven't figured out yet the best way to handle deleting rows as a part of filling
@@ -1313,6 +1325,12 @@ def assoc_column_position(self): | |||
def __getitem__(self, at_index): | |||
if not isinstance(at_index, int): | |||
raise TypeError('table indexing only accepts integers') | |||
if at_index < 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think negative index use needs some comments/description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I will add a comment around the handling.
93aa830
to
f61d260
Compare
This is to support the tables that have the + at the bottom which adds a new row.