def get(self): user = users.get_current_user() if user: user_name = user.nickname() user_url = users.create_logout_url("/") else: self.redirect(users.create_login_url("/")) return r = Row(name = 'NewRow', owner = user) r.put() self.redirect('/show')
def to_records(cls): columns = Column.count() rows = Row.count() return [[str(Cell.array[(row, column)]._data) if (row, column) in Cell.array else "" for column in range(columns)] for row in range(rows)]
def execute(self): # color = self.color.color.name(QtGui.QColor.HexRgb) query = Query(self.input.toPlainText()) query.execute() if query.error == Query.NoError: selection = Selection() selection.query = query DataView.Model.headerDataChanged.emit(Qt.Vertical, 0, Row.count())
def revert(self): self.random_sample_widget.setDisabled(True) self.case_range_widget.setDisabled(True) self.if_condition_btn.setDisabled(True) self.filter_variable_line.setDisabled(True) self.random_sample_widget.revert() # begin = data_view.cell_model.createIndex(0, 0) # end = data_view.cell_model.createIndex(100, 10) DataView.Model.headerDataChanged.emit(Qt.Vertical, 0, Row.count())
def execute(self): r = Row.count() approx, exact = RandomSample.Approximately, RandomSample.Exactly try: if r > 0: if self.type == approx: args = range(0, r), int(r * self.percent / 100) elif self.type == exact: args = range(0, self._from), self.no # print(*args) # print("r={}".format(r)) self.selection = sample(*args) except ValueError as e: logger.error(e)
def __init__(self, row, column, data=None): self.id = len(Cell.array) self.row_id = row self.column_id = column self._data = data column_obj = Column.get(column) row_obj = Row.get(row) if not self.column: self.column = Column(column) else: self.column = column_obj if not self.row: self.row = Row(row) else: self.row = row_obj Cell.array[(row, column)] = self
def get(self): user = users.get_current_user() if user: user_name = user.nickname() user_url = users.create_logout_url("/") else: self.redirect(users.create_login_url("/")) return now = datetime.datetime.now() now = now.replace(hour = 0, minute = 0, second = 0, microsecond = 0) rows = [] rows = Row.all().filter("owner =",user) text = 'Now: %s\n' % now text += 'User: %s, URL: %s\n' % (user_name, user_url) segments = make_segments(now, 15) template_rows = make_template_rows(segments, rows) self.response.out.write(template.render('templates/lines.html', {'text': text, 'segments': segments, 'template_rows': template_rows, 'user_name': user_name, 'user_url': user_url}))
def rowCount(self, QModelIndex_parent=None, *args, **kwargs): rows_count = Row.count() # logger.debug("rows_count={}".format(rows_count)) return CellModel.Rows
def from_changed(self, value): self.selection.random_sample.from_ = value DataView.Model.headerDataChanged.emit(Qt.Vertical, 0, Row.count()) logger.debug(value)
def to_changed(self, value): self.selection.range.to = value DataView.Model.headerDataChanged.emit(Qt.Vertical, 0, Row.count()) logger.debug(value)
def row(self): return Row.get(self.row_id)