workspace
stringclasses
1 value
channel
stringclasses
1 value
sentences
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
sentence_id
stringlengths
44
53
timestamp
float64
1.5B
1.56B
__index_level_0__
int64
0
106k
pythondev
help
So there's a many-to-many between bookmarks and users and not between user and feeds. Right?
2018-02-16T08:33:34.000094
Heath
pythondev_help_Heath_2018-02-16T08:33:34.000094
1,518,770,014.000094
34,424
pythondev
help
no-no
2018-02-16T08:34:13.000216
Barney
pythondev_help_Barney_2018-02-16T08:34:13.000216
1,518,770,053.000216
34,425
pythondev
help
There's a many-to-many between users and feeds, and it's called bookmarks
2018-02-16T08:34:25.000154
Barney
pythondev_help_Barney_2018-02-16T08:34:25.000154
1,518,770,065.000154
34,426
pythondev
help
Ok
2018-02-16T08:42:00.000639
Heath
pythondev_help_Heath_2018-02-16T08:42:00.000639
1,518,770,520.000639
34,427
pythondev
help
Got this
2018-02-16T08:42:03.000232
Heath
pythondev_help_Heath_2018-02-16T08:42:03.000232
1,518,770,523.000232
34,428
pythondev
help
<@Barney> How do I persist data now?
2018-02-16T08:42:10.000194
Heath
pythondev_help_Heath_2018-02-16T08:42:10.000194
1,518,770,530.000194
34,429
pythondev
help
`user.bookmarks` is a list-like structure now, so: ``` user.bookmarks.append(feed) ```
2018-02-16T08:43:54.000337
Barney
pythondev_help_Barney_2018-02-16T08:43:54.000337
1,518,770,634.000337
34,430
pythondev
help
See also: <http://docs.sqlalchemy.org/en/latest/orm/basic_relationships.html#many-to-many>
2018-02-16T08:44:09.000377
Barney
pythondev_help_Barney_2018-02-16T08:44:09.000377
1,518,770,649.000377
34,431
pythondev
help
how to remove a model from memory in flask? I created a model but accidentally named something twice!
2018-02-16T08:50:34.000007
Milo
pythondev_help_Milo_2018-02-16T08:50:34.000007
1,518,771,034.000007
34,432
pythondev
help
what do you mean?
2018-02-16T08:50:59.000101
Barney
pythondev_help_Barney_2018-02-16T08:50:59.000101
1,518,771,059.000101
34,433
pythondev
help
I created a model like so; ``` class Companies(db.Model): __tablename__ = 'companies' id = db.Column('id', db.Integer, primary_key=True, nullable=False) company = db.Column('company', NVARCHAR(255), nullable=False) company = db.Column('sector', NVARCHAR(255), nullable=False) rev_one = db.Column('...
2018-02-16T08:52:01.000428
Milo
pythondev_help_Milo_2018-02-16T08:52:01.000428
1,518,771,121.000428
34,434
pythondev
help
what error?
2018-02-16T08:52:26.000179
Barney
pythondev_help_Barney_2018-02-16T08:52:26.000179
1,518,771,146.000179
34,435
pythondev
help
```TypeError: 'sector' is an invalid keyword argument for Companies ```
2018-02-16T08:53:10.000552
Milo
pythondev_help_Milo_2018-02-16T08:53:10.000552
1,518,771,190.000552
34,436
pythondev
help
in fact I get another error when I run the function in the model class ``` def __repr__(self): return '&lt;Id {}&gt;'.format(self.id) ``` it prints `&lt;Id None&gt;` when it should print the correct id
2018-02-16T08:54:50.000330
Milo
pythondev_help_Milo_2018-02-16T08:54:50.000330
1,518,771,290.00033
34,437
pythondev
help
only if an instance has an ID already
2018-02-16T08:55:20.000079
Barney
pythondev_help_Barney_2018-02-16T08:55:20.000079
1,518,771,320.000079
34,438
pythondev
help
i.e., if it is persisted
2018-02-16T08:55:25.000217
Barney
pythondev_help_Barney_2018-02-16T08:55:25.000217
1,518,771,325.000217
34,439
pythondev
help
the data is already in the db
2018-02-16T08:55:36.000467
Milo
pythondev_help_Milo_2018-02-16T08:55:36.000467
1,518,771,336.000467
34,440
pythondev
help
:\
2018-02-16T08:55:54.000558
Barney
pythondev_help_Barney_2018-02-16T08:55:54.000558
1,518,771,354.000558
34,441
pythondev
help
oh maybe I need to use `str`?
2018-02-16T08:56:29.000140
Milo
pythondev_help_Milo_2018-02-16T08:56:29.000140
1,518,771,389.00014
34,442
pythondev
help
nope
2018-02-16T08:56:54.000283
Milo
pythondev_help_Milo_2018-02-16T08:56:54.000283
1,518,771,414.000283
34,443
pythondev
help
is the model set in memory? Is there a way to delete it and re do it?
2018-02-16T08:57:21.000178
Milo
pythondev_help_Milo_2018-02-16T08:57:21.000178
1,518,771,441.000178
34,444
pythondev
help
manyall delete the record from the db?
2018-02-16T08:58:46.000525
Floy
pythondev_help_Floy_2018-02-16T08:58:46.000525
1,518,771,526.000525
34,445
pythondev
help
make a migration?
2018-02-16T08:58:54.000433
Floy
pythondev_help_Floy_2018-02-16T08:58:54.000433
1,518,771,534.000433
34,446
pythondev
help
etc
2018-02-16T08:58:55.000560
Floy
pythondev_help_Floy_2018-02-16T08:58:55.000560
1,518,771,535.00056
34,447
pythondev
help
but I only named the variable in the model, the name in the db matched
2018-02-16T09:06:17.000631
Milo
pythondev_help_Milo_2018-02-16T09:06:17.000631
1,518,771,977.000631
34,448
pythondev
help
``` company = db.Column('company', NVARCHAR(255), nullable=False) company = db.Column('sector', NVARCHAR(255), nullable=False) ```
2018-02-16T09:06:44.000387
Milo
pythondev_help_Milo_2018-02-16T09:06:44.000387
1,518,772,004.000387
34,449
pythondev
help
I wrote company twice
2018-02-16T09:06:52.000435
Milo
pythondev_help_Milo_2018-02-16T09:06:52.000435
1,518,772,012.000435
34,450
pythondev
help
I don't see how renaming the second one to sector will break anything, really
2018-02-16T09:07:40.000141
Barney
pythondev_help_Barney_2018-02-16T09:07:40.000141
1,518,772,060.000141
34,451
pythondev
help
the bug is probably elsewhere
2018-02-16T09:07:58.000203
Barney
pythondev_help_Barney_2018-02-16T09:07:58.000203
1,518,772,078.000203
34,452
pythondev
help
do you have an `__init__` on a model?
2018-02-16T09:08:04.000288
Barney
pythondev_help_Barney_2018-02-16T09:08:04.000288
1,518,772,084.000288
34,453
pythondev
help
what's even weirder now is I am running a query ``` from app import app from app.models import Companies @app.route('/') def index(): companies = Companies.query.all() print(companies) return "Hello World"```
2018-02-16T09:08:06.000427
Milo
pythondev_help_Milo_2018-02-16T09:08:06.000427
1,518,772,086.000427
34,454
pythondev
help
and it prints an empty list
2018-02-16T09:08:14.000161
Milo
pythondev_help_Milo_2018-02-16T09:08:14.000161
1,518,772,094.000161
34,455
pythondev
help
what's weird about that?
2018-02-16T09:09:16.000429
Barney
pythondev_help_Barney_2018-02-16T09:09:16.000429
1,518,772,156.000429
34,456
pythondev
help
it should print the ten entries I have from the db
2018-02-16T09:09:34.000116
Milo
pythondev_help_Milo_2018-02-16T09:09:34.000116
1,518,772,174.000116
34,457
pythondev
help
can you launch pgcli and confirm they are there?
2018-02-16T09:09:58.000208
Barney
pythondev_help_Barney_2018-02-16T09:09:58.000208
1,518,772,198.000208
34,458
pythondev
help
or any similar tool for your database
2018-02-16T09:10:14.000551
Barney
pythondev_help_Barney_2018-02-16T09:10:14.000551
1,518,772,214.000551
34,459
pythondev
help
I've never seen SQLAlchemy being wrong before
2018-02-16T09:10:35.000089
Barney
pythondev_help_Barney_2018-02-16T09:10:35.000089
1,518,772,235.000089
34,460
pythondev
help
oh wait, I am an idiot, I copied my db credentials over from another project and forgot to change the db name :upside_down_face:
2018-02-16T09:10:45.000162
Milo
pythondev_help_Milo_2018-02-16T09:10:45.000162
1,518,772,245.000162
34,461
pythondev
help
let me test and see
2018-02-16T09:10:55.000015
Milo
pythondev_help_Milo_2018-02-16T09:10:55.000015
1,518,772,255.000015
34,462
pythondev
help
yup that was the problem!
2018-02-16T09:12:04.000491
Milo
pythondev_help_Milo_2018-02-16T09:12:04.000491
1,518,772,324.000491
34,463
pythondev
help
:)
2018-02-16T09:12:20.000207
Barney
pythondev_help_Barney_2018-02-16T09:12:20.000207
1,518,772,340.000207
34,464
pythondev
help
Object '&lt;Feed at 0x7f009f189eb8&gt;' is already attached to session '48'
2018-02-16T09:13:00.000499
Heath
pythondev_help_Heath_2018-02-16T09:13:00.000499
1,518,772,380.000499
34,465
pythondev
help
<@Barney> Any workaround for this?
2018-02-16T09:13:22.000309
Heath
pythondev_help_Heath_2018-02-16T09:13:22.000309
1,518,772,402.000309
34,466
pythondev
help
no idea what this is
2018-02-16T09:13:46.000542
Barney
pythondev_help_Barney_2018-02-16T09:13:46.000542
1,518,772,426.000542
34,467
pythondev
help
you're using multiple sessions for some reason, which is a bit strange
2018-02-16T09:14:09.000637
Barney
pythondev_help_Barney_2018-02-16T09:14:09.000637
1,518,772,449.000637
34,468
pythondev
help
I think I figured it ou
2018-02-16T09:15:43.000288
Heath
pythondev_help_Heath_2018-02-16T09:15:43.000288
1,518,772,543.000288
34,469
pythondev
help
out*
2018-02-16T09:15:46.000554
Heath
pythondev_help_Heath_2018-02-16T09:15:46.000554
1,518,772,546.000554
34,470
pythondev
help
<@Barney> A :taco: for you
2018-02-16T09:35:51.000341
Heath
pythondev_help_Heath_2018-02-16T09:35:51.000341
1,518,773,751.000341
34,471
pythondev
help
my flask wtform is not validating on submit, and hence not printing anything out, here is my view ``` @app.route('/', methods=['GET', 'POST']) def index(): companies = Companies.query.all() class CompaniesForm(FlaskForm): pass for x in companies: setattr( CompaniesForm, ...
2018-02-16T10:34:21.000127
Milo
pythondev_help_Milo_2018-02-16T10:34:21.000127
1,518,777,261.000127
34,472
pythondev
help
i’m having an interesting problem where the string ‘../foo/bar’ is not going up a level in jinjas FileSystemLoader as i would expect
2018-02-16T10:48:09.000294
Tobias
pythondev_help_Tobias_2018-02-16T10:48:09.000294
1,518,778,089.000294
34,473
pythondev
help
i’m wondering if there is a way to force ../ to expand before sending it to the filesystemloader?
2018-02-16T10:48:29.000466
Tobias
pythondev_help_Tobias_2018-02-16T10:48:29.000466
1,518,778,109.000466
34,474
pythondev
help
solved it, was missing `csrf token`
2018-02-16T11:03:24.000304
Milo
pythondev_help_Milo_2018-02-16T11:03:24.000304
1,518,779,004.000304
34,475
pythondev
help
style question. I often advocate the following change, but I get pushback and have the impression that I’m going against python conventions (maybe there is even a pep8 counter-indicating it?): wrong: ``` long_name_plus_indentationion_makes_this_gross = [ "foo", ...
2018-02-16T11:06:42.000698
Kieth
pythondev_help_Kieth_2018-02-16T11:06:42.000698
1,518,779,202.000698
34,476
pythondev
help
I am posting some data that is coming through successfully however after that post I want to re-render the same template, but instead of just showing what was originally on the template, show some new content on the page is this possible in flask
2018-02-16T11:09:59.000773
Milo
pythondev_help_Milo_2018-02-16T11:09:59.000773
1,518,779,399.000773
34,477
pythondev
help
in a view am I allowed to have this on the `GET`: ``` return render_template('home.html', form=form, data=companies, values=None, labels=None)``` and this on the `form.validation_on_submit():`: ``` render_template('home.html', form=form, data=companies, values=values, labels=labels) ```
2018-02-16T11:43:54.000647
Milo
pythondev_help_Milo_2018-02-16T11:43:54.000647
1,518,781,434.000647
34,478
pythondev
help
Sure. Although there might be a better way to structure your code to avoid the duplication.
2018-02-16T11:45:33.000751
Patricia
pythondev_help_Patricia_2018-02-16T11:45:33.000751
1,518,781,533.000751
34,479
pythondev
help
<@Milo> To answer your initial question, yes it's possible, and very common
2018-02-16T11:46:23.000518
Porsha
pythondev_help_Porsha_2018-02-16T11:46:23.000518
1,518,781,583.000518
34,480
pythondev
help
When posting to the server from a form, use the `post` method
2018-02-16T11:46:40.000549
Porsha
pythondev_help_Porsha_2018-02-16T11:46:40.000549
1,518,781,600.000549
34,481
pythondev
help
We do both and flake8 accepts both I believe. It depends on where you put the ending bracket. You can't do the second version and put the ending bracket on the last line.
2018-02-16T11:47:13.000432
Patricia
pythondev_help_Patricia_2018-02-16T11:47:13.000432
1,518,781,633.000432
34,482
pythondev
help
Flask has some handy methods of getting the form data, which you can store as a variable or a dict, then pass back into the `render_template` function
2018-02-16T11:47:29.000139
Porsha
pythondev_help_Porsha_2018-02-16T11:47:29.000139
1,518,781,649.000139
34,483
pythondev
help
I would advocate for the second version assuming your line length limit forces the first version to look like it does.
2018-02-16T11:47:45.000388
Patricia
pythondev_help_Patricia_2018-02-16T11:47:45.000388
1,518,781,665.000388
34,484
pythondev
help
I like to refer to this overall document and in your case this link ( <https://google.github.io/styleguide/pyguide.html?showone=Line_length#Line_length> ) because it contrasts PEP8 nicely
2018-02-16T11:48:04.000503
Monroe
pythondev_help_Monroe_2018-02-16T11:48:04.000503
1,518,781,684.000503
34,485
pythondev
help
did you mean in my template? As it is posting the data through, but when I try to re-render it doesn't do anything, I can print my results to the console
2018-02-16T11:49:20.000385
Milo
pythondev_help_Milo_2018-02-16T11:49:20.000385
1,518,781,760.000385
34,486
pythondev
help
but it doesn't re-render
2018-02-16T11:49:29.000414
Milo
pythondev_help_Milo_2018-02-16T11:49:29.000414
1,518,781,769.000414
34,487
pythondev
help
`form.errors` prints an empty dictionary as well
2018-02-16T11:52:11.000776
Milo
pythondev_help_Milo_2018-02-16T11:52:11.000776
1,518,781,931.000776
34,488
pythondev
help
You can create a new html page to render the results
2018-02-16T11:53:37.000269
Porsha
pythondev_help_Porsha_2018-02-16T11:53:37.000269
1,518,782,017.000269
34,489
pythondev
help
i was thinking that, but it would be nicer to have it on the same page, as the user might want to use the first form again, its for a chart
2018-02-16T11:54:19.000061
Milo
pythondev_help_Milo_2018-02-16T11:54:19.000061
1,518,782,059.000061
34,490
pythondev
help
Also <https://google.github.io/styleguide/pyguide.html?showone=Indentation#Indentation>
2018-02-16T11:54:41.000682
Monroe
pythondev_help_Monroe_2018-02-16T11:54:41.000682
1,518,782,081.000682
34,491
pythondev
help
Though that one does not settle it, rather allows both (or more versions). Personally I like your "right" way
2018-02-16T11:55:21.000420
Monroe
pythondev_help_Monroe_2018-02-16T11:55:21.000420
1,518,782,121.00042
34,492
pythondev
help
so `input.html` would be my original template with my form? Ideally I want it to display on the same chart
2018-02-16T12:00:04.000814
Milo
pythondev_help_Milo_2018-02-16T12:00:04.000814
1,518,782,404.000814
34,493
pythondev
help
You could have another form on results.html that re-uses the same route
2018-02-16T12:00:50.000179
Porsha
pythondev_help_Porsha_2018-02-16T12:00:50.000179
1,518,782,450.000179
34,494
pythondev
help
You just change the variable values depending on the form data
2018-02-16T12:01:17.000797
Porsha
pythondev_help_Porsha_2018-02-16T12:01:17.000797
1,518,782,477.000797
34,495
pythondev
help
ah ok that makes sense, but the only problem with that is that I am also going to be adding in sliders for the chart, would they live on results.html as well?
2018-02-16T12:01:55.000428
Milo
pythondev_help_Milo_2018-02-16T12:01:55.000428
1,518,782,515.000428
34,496
pythondev
help
Assuming that the sliders have a value attribute and you'll be sending that data in the form `post` I see no issue
2018-02-16T12:03:09.000517
Porsha
pythondev_help_Porsha_2018-02-16T12:03:09.000517
1,518,782,589.000517
34,497
pythondev
help
ok cool, will give it a go, thanks <@Porsha> :taco:
2018-02-16T12:03:36.000144
Milo
pythondev_help_Milo_2018-02-16T12:03:36.000144
1,518,782,616.000144
34,498
pythondev
help
:smiley:
2018-02-16T12:03:48.000070
Porsha
pythondev_help_Porsha_2018-02-16T12:03:48.000070
1,518,782,628.00007
34,499
pythondev
help
Dumb question - I have a function inside of a class that returns a list with data and a list with dates. I want those to be in the same function. The function returns `return (date_range, time_series_list)`. I just realized I'm calling the function twice with: ``` self.date_range_this_month = self.get_this_month()[0] s...
2018-02-16T13:05:41.000389
Jerry
pythondev_help_Jerry_2018-02-16T13:05:41.000389
1,518,786,341.000389
34,500
pythondev
help
`a, b = my_function()`
2018-02-16T13:08:22.000551
Micki
pythondev_help_Micki_2018-02-16T13:08:22.000551
1,518,786,502.000551
34,501
pythondev
help
<@Audie> duhhhh - knew it was easy. Thanks :slightly_smiling_face: :taco:
2018-02-16T13:09:12.000045
Jerry
pythondev_help_Jerry_2018-02-16T13:09:12.000045
1,518,786,552.000045
34,502
pythondev
help
Hey so i have few questions if anyone is around
2018-02-16T18:45:04.000047
Felecia
pythondev_help_Felecia_2018-02-16T18:45:04.000047
1,518,806,704.000047
34,503
pythondev
help
You should pretty much always just ask your questions
2018-02-16T18:49:10.000180
Garrett
pythondev_help_Garrett_2018-02-16T18:49:10.000180
1,518,806,950.00018
34,504
pythondev
help
im have quite a bit of user inputs that I want to export,what would be the best way to do so? is there a export all variables func?
2018-02-16T18:58:21.000037
Felecia
pythondev_help_Felecia_2018-02-16T18:58:21.000037
1,518,807,501.000037
34,505
pythondev
help
I have*
2018-02-16T19:00:20.000038
Felecia
pythondev_help_Felecia_2018-02-16T19:00:20.000038
1,518,807,620.000038
34,506
pythondev
help
Can you give more details? Not sure what you mean by exporting variables?
2018-02-16T19:00:29.000143
Floy
pythondev_help_Floy_2018-02-16T19:00:29.000143
1,518,807,629.000143
34,507
pythondev
help
I have multiple questions and want to export the answers
2018-02-16T19:01:22.000015
Felecia
pythondev_help_Felecia_2018-02-16T19:01:22.000015
1,518,807,682.000015
34,508
pythondev
help
`locals()` will give you all of the local variables
2018-02-16T19:04:25.000143
Garrett
pythondev_help_Garrett_2018-02-16T19:04:25.000143
1,518,807,865.000143
34,509
pythondev
help
I could see do this with a dict instead, though
2018-02-16T19:06:43.000099
Garrett
pythondev_help_Garrett_2018-02-16T19:06:43.000099
1,518,808,003.000099
34,510
pythondev
help
can you explain?
2018-02-16T19:08:51.000254
Felecia
pythondev_help_Felecia_2018-02-16T19:08:51.000254
1,518,808,131.000254
34,511
pythondev
help
``` questions = { 'Name of this production': None, 'Date of production': None, 'Production start time': None } for question in questions: questions[question] = input(f'{question}: ') ```
2018-02-16T19:10:02.000247
Garrett
pythondev_help_Garrett_2018-02-16T19:10:02.000247
1,518,808,202.000247
34,512
pythondev
help
Then, at the end, just export `questions`
2018-02-16T19:11:55.000045
Garrett
pythondev_help_Garrett_2018-02-16T19:11:55.000045
1,518,808,315.000045
34,513
pythondev
help
You'll have associated questions and answers.
2018-02-16T19:12:00.000311
Garrett
pythondev_help_Garrett_2018-02-16T19:12:00.000311
1,518,808,320.000311
34,514
pythondev
help
thank you!
2018-02-16T19:12:57.000083
Felecia
pythondev_help_Felecia_2018-02-16T19:12:57.000083
1,518,808,377.000083
34,515
pythondev
help
That may not be the best, and definitely isn't the only, solution but it's a fairly clean one
2018-02-16T19:15:45.000021
Garrett
pythondev_help_Garrett_2018-02-16T19:15:45.000021
1,518,808,545.000021
34,516
pythondev
help
well thank you for you help
2018-02-16T19:19:05.000055
Felecia
pythondev_help_Felecia_2018-02-16T19:19:05.000055
1,518,808,745.000055
34,517
pythondev
help
trying to build a JS method in python, but not sure how close I am. Would like someone more familiar with JS and struct to double check my work.
2018-02-16T19:26:44.000108
Jacquelyn
pythondev_help_Jacquelyn_2018-02-16T19:26:44.000108
1,518,809,204.000108
34,518
pythondev
help
<@Jacquelyn> Use the `+` button to the right of the chat input to drop in code snippets
2018-02-16T19:27:51.000205
Porsha
pythondev_help_Porsha_2018-02-16T19:27:51.000205
1,518,809,271.000205
34,519
pythondev
help
Much easier for people to read
2018-02-16T19:28:03.000196
Porsha
pythondev_help_Porsha_2018-02-16T19:28:03.000196
1,518,809,283.000196
34,520
pythondev
help
especially the encodedPayload part, not to sure on that one
2018-02-16T19:31:03.000138
Jacquelyn
pythondev_help_Jacquelyn_2018-02-16T19:31:03.000138
1,518,809,463.000138
34,521
pythondev
help
`question` is a local variable within the for loop but you're using it outside the loop in `f.write(question)`
2018-02-16T20:12:52.000080
Porsha
pythondev_help_Porsha_2018-02-16T20:12:52.000080
1,518,811,972.00008
34,522
pythondev
help
so make it a global variable?
2018-02-16T20:16:45.000046
Felecia
pythondev_help_Felecia_2018-02-16T20:16:45.000046
1,518,812,205.000046
34,523