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 I got the `ul` element set up and the checkbox plugin enabled for jstree, but I can't figure out where to put the name attribute!
2018-01-08T10:18:51.000510
Milo
pythondev_help_Milo_2018-01-08T10:18:51.000510
1,515,406,731.00051
28,124
pythondev
help
name attribute?
2018-01-08T10:20:21.000818
Floy
pythondev_help_Floy_2018-01-08T10:20:21.000818
1,515,406,821.000818
28,125
pythondev
help
show some code
2018-01-08T10:20:49.000156
Floy
pythondev_help_Floy_2018-01-08T10:20:49.000156
1,515,406,849.000156
28,126
pythondev
help
``` <ul> <li> Child Node </li> </ul> $(document).ready(function () { $('.data').jstree({ "plugins" :['checkbox'], "core": { "themes":{ "icons":false } } }); ```
2018-01-08T10:26:50.000023
Milo
pythondev_help_Milo_2018-01-08T10:26:50.000023
1,515,407,210.000023
28,127
pythondev
help
I want to get the value of the li in flask not js
2018-01-08T10:27:08.000569
Milo
pythondev_help_Milo_2018-01-08T10:27:08.000569
1,515,407,228.000569
28,128
pythondev
help
ok, so I think you might be working under a misperception. Flask, like with all other web frameworks, splits the responsibility between the browser and server. You can use flask to render the html content that the browser will display, or implement an API to be consumed by a JS application and render it. so here, ...
2018-01-08T10:29:50.000158
Floy
pythondev_help_Floy_2018-01-08T10:29:50.000158
1,515,407,390.000158
28,129
pythondev
help
ah ok, I just had a thought, could I not use the checkbox plugin and instead write in my own `input` elements with their own unique `name` attributes. Would something like this work? As my js skills aren't that great
2018-01-08T10:32:04.000266
Milo
pythondev_help_Milo_2018-01-08T10:32:04.000266
1,515,407,524.000266
28,130
pythondev
help
why do you need a name attribute anyway?
2018-01-08T10:32:18.000795
Floy
pythondev_help_Floy_2018-01-08T10:32:18.000795
1,515,407,538.000795
28,131
pythondev
help
for requesting on flask side
2018-01-08T10:32:59.000087
Milo
pythondev_help_Milo_2018-01-08T10:32:59.000087
1,515,407,579.000087
28,132
pythondev
help
using request.args['name']
2018-01-08T10:33:12.000313
Milo
pythondev_help_Milo_2018-01-08T10:33:12.000313
1,515,407,592.000313
28,133
pythondev
help
so is the name attribute value going to be any different than the text of that element?
2018-01-08T10:33:56.000846
Floy
pythondev_help_Floy_2018-01-08T10:33:56.000846
1,515,407,636.000846
28,134
pythondev
help
yes its going to be an id number
2018-01-08T10:34:12.000448
Milo
pythondev_help_Milo_2018-01-08T10:34:12.000448
1,515,407,652.000448
28,135
pythondev
help
alright
2018-01-08T10:34:30.000484
Floy
pythondev_help_Floy_2018-01-08T10:34:30.000484
1,515,407,670.000484
28,136
pythondev
help
as I am looping through loads of data within the template
2018-01-08T10:34:32.000448
Milo
pythondev_help_Milo_2018-01-08T10:34:32.000448
1,515,407,672.000448
28,137
pythondev
help
ok, so you’re going to have to add an event handler on those elements
2018-01-08T10:34:48.000806
Floy
pythondev_help_Floy_2018-01-08T10:34:48.000806
1,515,407,688.000806
28,138
pythondev
help
when it fires on a click, you’ll get the element and all its properties
2018-01-08T10:35:04.000371
Floy
pythondev_help_Floy_2018-01-08T10:35:04.000371
1,515,407,704.000371
28,139
pythondev
help
using that, you can then send a request to flask
2018-01-08T10:35:14.000470
Floy
pythondev_help_Floy_2018-01-08T10:35:14.000470
1,515,407,714.00047
28,140
pythondev
help
You could submit it using a simple html form
2018-01-08T10:35:26.000503
Porsha
pythondev_help_Porsha_2018-01-08T10:35:26.000503
1,515,407,726.000503
28,141
pythondev
help
I currently have this placed within a form that I am already posting to flask
2018-01-08T10:35:33.000257
Milo
pythondev_help_Milo_2018-01-08T10:35:33.000257
1,515,407,733.000257
28,142
pythondev
help
Ok so you don't need to use jquery to submit it
2018-01-08T10:35:57.000434
Porsha
pythondev_help_Porsha_2018-01-08T10:35:57.000434
1,515,407,757.000434
28,143
pythondev
help
That means I won't use the checkbox plugin then
2018-01-08T10:36:28.000217
Milo
pythondev_help_Milo_2018-01-08T10:36:28.000217
1,515,407,788.000217
28,144
pythondev
help
As long as you have the form setup to post to a flask view, the form will handle it
2018-01-08T10:37:00.000344
Porsha
pythondev_help_Porsha_2018-01-08T10:37:00.000344
1,515,407,820.000344
28,145
pythondev
help
Oh I see you're using a plugin
2018-01-08T10:37:11.000261
Porsha
pythondev_help_Porsha_2018-01-08T10:37:11.000261
1,515,407,831.000261
28,146
pythondev
help
yup
2018-01-08T10:37:15.000783
Milo
pythondev_help_Milo_2018-01-08T10:37:15.000783
1,515,407,835.000783
28,147
pythondev
help
its for the tree dropdown
2018-01-08T10:37:25.000167
Milo
pythondev_help_Milo_2018-01-08T10:37:25.000167
1,515,407,845.000167
28,148
pythondev
help
Can't you use the default html checkbox inside the form?
2018-01-08T10:37:26.000492
Porsha
pythondev_help_Porsha_2018-01-08T10:37:26.000492
1,515,407,846.000492
28,149
pythondev
help
That is what I was mentioning up above instead of using the plugin checkbox. Will give it a go now
2018-01-08T10:37:59.000571
Milo
pythondev_help_Milo_2018-01-08T10:37:59.000571
1,515,407,879.000571
28,150
pythondev
help
Is that the only data you want to send to the flask app?
2018-01-08T10:38:21.000230
Porsha
pythondev_help_Porsha_2018-01-08T10:38:21.000230
1,515,407,901.00023
28,151
pythondev
help
I.e. it's not nested inside another form
2018-01-08T10:38:30.000243
Porsha
pythondev_help_Porsha_2018-01-08T10:38:30.000243
1,515,407,910.000243
28,152
pythondev
help
no that and other data but its part of the same form
2018-01-08T10:38:53.000237
Milo
pythondev_help_Milo_2018-01-08T10:38:53.000237
1,515,407,933.000237
28,153
pythondev
help
You're better off sending it all as either a form post, or getting all the form values using jquery and sending a post requerst using the .click() function and sending an ajax request containing all the data
2018-01-08T10:40:11.000116
Porsha
pythondev_help_Porsha_2018-01-08T10:40:11.000116
1,515,408,011.000116
28,154
pythondev
help
Ok cool will try the form post first and see how I get on.
2018-01-08T10:40:38.000589
Milo
pythondev_help_Milo_2018-01-08T10:40:38.000589
1,515,408,038.000589
28,155
pythondev
help
If you go down the jquery route, you dont need to nest the input tags in a form tag
2018-01-08T10:41:05.000488
Porsha
pythondev_help_Porsha_2018-01-08T10:41:05.000488
1,515,408,065.000488
28,156
pythondev
help
didn't think of that. ok will give both a go, my js skills aren't the greatest but will have a read through
2018-01-08T10:41:46.000220
Milo
pythondev_help_Milo_2018-01-08T10:41:46.000220
1,515,408,106.00022
28,157
pythondev
help
Thanks for the help :grinning: <@Porsha> and <@Floy>
2018-01-08T10:42:23.000273
Milo
pythondev_help_Milo_2018-01-08T10:42:23.000273
1,515,408,143.000273
28,158
pythondev
help
If you need help with the jquery method. I'm using something very similar on one of my sites so can drop you some code examples
2018-01-08T10:43:02.000642
Porsha
pythondev_help_Porsha_2018-01-08T10:43:02.000642
1,515,408,182.000642
28,159
pythondev
help
Cool I just had a thought about the jquery method, as it seems that it will only pass whatever value is in the `li` element I actually don't want that value as that is just plain text I want the id associated with it, would I still be able pass that (kind of like a hidden element?)
2018-01-08T10:44:52.000328
Milo
pythondev_help_Milo_2018-01-08T10:44:52.000328
1,515,408,292.000328
28,160
pythondev
help
Yes you can get any tag attribute value using jquery
2018-01-08T10:45:26.000017
Porsha
pythondev_help_Porsha_2018-01-08T10:45:26.000017
1,515,408,326.000017
28,161
pythondev
help
example
2018-01-08T10:50:17.000394
Porsha
pythondev_help_Porsha_2018-01-08T10:50:17.000394
1,515,408,617.000394
28,162
pythondev
help
```&lt;p&gt; &lt;input name="has_ga" type="checkbox" id="has_ga" value="true" /&gt; &lt;label for="has_ga"&gt;Google Analytics&lt;/label&gt; &lt;/p&gt; &lt;script&gt; var $googleAnalytics = $("#has_ga").is(":checked"); // returns True is checked or False if unchecked var $gaUsername = $("#ga_username").val(); //...
2018-01-08T10:50:21.000110
Porsha
pythondev_help_Porsha_2018-01-08T10:50:21.000110
1,515,408,621.00011
28,163
pythondev
help
Hi everyone I am a beginner python beginner I have a question about python mongo orm like package(mongoengine) Can anyone help me? I declare a class as below ``` class Product(Document): types = StringField() option = DictField( name = StringField(), types = StringField() ) ``` But I get t...
2018-01-08T11:29:27.000572
Azalee
pythondev_help_Azalee_2018-01-08T11:29:27.000572
1,515,410,967.000572
28,164
pythondev
help
<@Azalee> Please use code formatting (three back ticks on both sides on their own line, the key above tab on US keyboards ` ` `)
2018-01-08T11:33:53.000447
Rafael
pythondev_help_Rafael_2018-01-08T11:33:53.000447
1,515,411,233.000447
28,165
pythondev
help
Also, out of curiousity, why are you structuring data for a datastore meant for unstructured data? If you need an ORM you more likely than not should just be using a SQL solution
2018-01-08T11:34:33.000429
Brande
pythondev_help_Brande_2018-01-08T11:34:33.000429
1,515,411,273.000429
28,166
pythondev
help
and provide information about the error
2018-01-08T11:34:36.000118
Floy
pythondev_help_Floy_2018-01-08T11:34:36.000118
1,515,411,276.000118
28,167
pythondev
help
yeah the error is kind of key. :slightly_smiling_face:
2018-01-08T11:46:40.000220
Zack
pythondev_help_Zack_2018-01-08T11:46:40.000220
1,515,412,000.00022
28,168
pythondev
help
is there a codereview section on here?
2018-01-08T11:47:04.000578
Cuc
pythondev_help_Cuc_2018-01-08T11:47:04.000578
1,515,412,024.000578
28,169
pythondev
help
or is that meant for help?
2018-01-08T11:47:07.000585
Cuc
pythondev_help_Cuc_2018-01-08T11:47:07.000585
1,515,412,027.000585
28,170
pythondev
help
but there’s nothing abnormal about declaring a schema in the application like that, the big thing to avoid is it being heavily relational
2018-01-08T11:47:24.000424
Zack
pythondev_help_Zack_2018-01-08T11:47:24.000424
1,515,412,044.000424
28,171
pythondev
help
there was, AFAIK, but it was not active for long periods
2018-01-08T11:47:32.000874
Floy
pythondev_help_Floy_2018-01-08T11:47:32.000874
1,515,412,052.000874
28,172
pythondev
help
so ask here, or if you’re doing django/flask/pandas stuff, you can ask in the respective channel
2018-01-08T11:47:56.000606
Floy
pythondev_help_Floy_2018-01-08T11:47:56.000606
1,515,412,076.000606
28,173
pythondev
help
if you’re declaring a schema, then why store the data in a schemaless storage? mongo ORMs shouldnt even exist
2018-01-08T11:48:28.000578
Brande
pythondev_help_Brande_2018-01-08T11:48:28.000578
1,515,412,108.000578
28,174
pythondev
help
<@Brande> well technically it’s not an ORM, it’s ODM, so says them. Although I’ll admit I occasionally refer to it as an ORM myself, just out of habit.
2018-01-08T11:48:57.000190
Zack
pythondev_help_Zack_2018-01-08T11:48:57.000190
1,515,412,137.00019
28,175
pythondev
help
But the point of a schemaless data-store is not that there exists no schema anywhere, there always is, just that it isn’t enforced by the database
2018-01-08T11:49:17.000103
Zack
pythondev_help_Zack_2018-01-08T11:49:17.000103
1,515,412,157.000103
28,176
pythondev
help
which is a great way to shoot yourself in the foot
2018-01-08T11:49:38.000521
Brande
pythondev_help_Brande_2018-01-08T11:49:38.000521
1,515,412,178.000521
28,177
pythondev
help
nosql has its places; structured data ain’t it
2018-01-08T11:49:45.000348
Brande
pythondev_help_Brande_2018-01-08T11:49:45.000348
1,515,412,185.000348
28,178
pythondev
help
well I mean there’s always structure to the data somewhere
2018-01-08T11:49:57.000417
Zack
pythondev_help_Zack_2018-01-08T11:49:57.000417
1,515,412,197.000417
28,179
pythondev
help
nope, i use nosql here, in a truly unstructured fashion
2018-01-08T11:50:11.000390
Brande
pythondev_help_Brande_2018-01-08T11:50:11.000390
1,515,412,211.00039
28,180
pythondev
help
as a document store, which is what its designed for
2018-01-08T11:50:17.000838
Brande
pythondev_help_Brande_2018-01-08T11:50:17.000838
1,515,412,217.000838
28,181
pythondev
help
I mean maybe. But what do you think mongoengine exists for then?
2018-01-08T11:50:24.000376
Zack
pythondev_help_Zack_2018-01-08T11:50:24.000376
1,515,412,224.000376
28,182
pythondev
help
my argument is they shouldnt exist
2018-01-08T11:51:01.000543
Brande
pythondev_help_Brande_2018-01-08T11:51:01.000543
1,515,412,261.000543
28,183
pythondev
help
like mongoose in node
2018-01-08T11:51:11.000686
Brande
pythondev_help_Brande_2018-01-08T11:51:11.000686
1,515,412,271.000686
28,184
pythondev
help
ah, not so much that they don’t, I see, I misunderstood you
2018-01-08T11:51:14.000070
Zack
pythondev_help_Zack_2018-01-08T11:51:14.000070
1,515,412,274.00007
28,185
pythondev
help
well, it’s certainly not for every application, I’d agree with that. but it can be pretty powerful when used effectively
2018-01-08T11:51:37.000240
Zack
pythondev_help_Zack_2018-01-08T11:51:37.000240
1,515,412,297.00024
28,186
pythondev
help
as soon as there are common structures you get nothing from it, and its slower to search that most sql. if you are structuring data, just put it in a structured place
2018-01-08T11:52:30.000062
Brande
pythondev_help_Brande_2018-01-08T11:52:30.000062
1,515,412,350.000062
28,187
pythondev
help
that’s not necessarily the case - it helps with cases where you want to be able to maintain multiple schema versions over time, which is useful in phased upgrades and the like
2018-01-08T11:53:36.000225
Zack
pythondev_help_Zack_2018-01-08T11:53:36.000225
1,515,412,416.000225
28,188
pythondev
help
also schemaless dbs tend to have different availability characteristics which can be desirable as well
2018-01-08T11:53:56.000424
Zack
pythondev_help_Zack_2018-01-08T11:53:56.000424
1,515,412,436.000424
28,189
pythondev
help
yeah, for non-structured on normalized data
2018-01-08T11:55:19.000685
Brande
pythondev_help_Brande_2018-01-08T11:55:19.000685
1,515,412,519.000685
28,190
pythondev
help
but as soon as you do that, you’re going in the wrong way
2018-01-08T11:55:29.000713
Brande
pythondev_help_Brande_2018-01-08T11:55:29.000713
1,515,412,529.000713
28,191
pythondev
help
and schema versions can be handled easily with any ORM and migrations
2018-01-08T11:55:51.000422
Brande
pythondev_help_Brande_2018-01-08T11:55:51.000422
1,515,412,551.000422
28,192
pythondev
help
right - but then all your deployed applications need to be using the same thing as well
2018-01-08T11:56:08.000348
Zack
pythondev_help_Zack_2018-01-08T11:56:08.000348
1,515,412,568.000348
28,193
pythondev
help
no? migrations arent limited in a way where everything has to be the same, it’s why they are versioned
2018-01-08T11:57:06.000302
Brande
pythondev_help_Brande_2018-01-08T11:57:06.000302
1,515,412,626.000302
28,194
pythondev
help
certainly the way I’ve seen them handled everywhere it’s more difficult.
2018-01-08T11:57:32.000559
Zack
pythondev_help_Zack_2018-01-08T11:57:32.000559
1,515,412,652.000559
28,195
pythondev
help
there’s a couple good chapters on this in Designing Data Intensive Applications. Highly recommended for more than just this little area, but it goes into a deep dive on the relative trade offs here.
2018-01-08T11:58:20.000432
Zack
pythondev_help_Zack_2018-01-08T11:58:20.000432
1,515,412,700.000432
28,196
pythondev
help
You've enclosed name and types in the parentheses of option
2018-01-08T13:16:03.000309
Porsha
pythondev_help_Porsha_2018-01-08T13:16:03.000309
1,515,417,363.000309
28,197
pythondev
help
#idea
2018-01-08T14:11:57.000207
Samatha
pythondev_help_Samatha_2018-01-08T14:11:57.000207
1,515,420,717.000207
28,198
pythondev
help
<#C3X4T24LB|databases>
2018-01-08T14:12:18.000031
Samatha
pythondev_help_Samatha_2018-01-08T14:12:18.000031
1,515,420,738.000031
28,199
pythondev
help
@Matt. Thanks a lot <@Brande> so sorry I just take a little part schemafor sample
2018-01-08T14:25:36.000185
Azalee
pythondev_help_Azalee_2018-01-08T14:25:36.000185
1,515,421,536.000185
28,200
pythondev
help
<@Porsha> thanks. But earlier I don't know how to solve this problem except change the variable names
2018-01-08T14:28:05.000185
Azalee
pythondev_help_Azalee_2018-01-08T14:28:05.000185
1,515,421,685.000185
28,201
pythondev
help
Is anybody trying to learn data structures and/or interviewing code challenges? I’m pretty beginner to both and was wondering if anybody would like to be an accountability partner, or work together (if you’re also beginner or would just like to). I’m going through the first course on this link (non-certificate means no...
2018-01-08T15:06:35.000451
Winifred
pythondev_help_Winifred_2018-01-08T15:06:35.000451
1,515,423,995.000451
28,202
pythondev
help
Hi all, just started a project in Python where I need to take a Google Sheets page which updates every morning and it needs to be input into a MySQL database. Anyone have suggestions on how to do it in order to comply with good database architecture? It has something like 8 dimensions and 5 metrics (web analytics data)...
2018-01-08T16:35:44.000534
Cecille
pythondev_help_Cecille_2018-01-08T16:35:44.000534
1,515,429,344.000534
28,203
pythondev
help
if it’s a flat file format you could create what i call a “loader table” which is simply a flat table structure. You could later run other jobs that read from this table which transforms the data into a more normalized format or create fact tables or whatever you want.
2018-01-08T16:49:01.000147
Davina
pythondev_help_Davina_2018-01-08T16:49:01.000147
1,515,430,141.000147
28,204
pythondev
help
good database architecture also depends on if something is highly transactional with reads vs writes, etc.
2018-01-08T16:50:27.000014
Davina
pythondev_help_Davina_2018-01-08T16:50:27.000014
1,515,430,227.000014
28,205
pythondev
help
but i guess doing that would be a lot more storage.
2018-01-08T16:52:25.000389
Davina
pythondev_help_Davina_2018-01-08T16:52:25.000389
1,515,430,345.000389
28,206
pythondev
help
you would then need to have `get_or_create_foo` functions based on your fact tables.
2018-01-08T16:53:11.000358
Davina
pythondev_help_Davina_2018-01-08T16:53:11.000358
1,515,430,391.000358
28,207
pythondev
help
and insert the primary key to that lookup.
2018-01-08T16:53:30.000005
Davina
pythondev_help_Davina_2018-01-08T16:53:30.000005
1,515,430,410.000005
28,208
pythondev
help
If I have a python application that includes a virtualenv with all required dependencies, does the person I am distributing the application to need Python installed on their computer or can they just cd to the directory and source env/bin/activate?
2018-01-08T17:30:59.000480
Gregoria
pythondev_help_Gregoria_2018-01-08T17:30:59.000480
1,515,432,659.00048
28,209
pythondev
help
how would that person run the venv?
2018-01-08T17:32:31.000629
Dominica
pythondev_help_Dominica_2018-01-08T17:32:31.000629
1,515,432,751.000629
28,210
pythondev
help
Just saw "source env/bin/activate" at the end. Good question. Is `source` doable in win? Doesn't all linux comes w/ python, no?
2018-01-08T17:34:50.000165
Dominica
pythondev_help_Dominica_2018-01-08T17:34:50.000165
1,515,432,890.000165
28,211
pythondev
help
Well windows would be .\env\Scripts\activate
2018-01-08T17:35:16.000335
Gregoria
pythondev_help_Gregoria_2018-01-08T17:35:16.000335
1,515,432,916.000335
28,212
pythondev
help
You shouldn't distribute virtualenvs.
2018-01-08T17:35:41.000320
Garrett
pythondev_help_Garrett_2018-01-08T17:35:41.000320
1,515,432,941.00032
28,213
pythondev
help
This is what `requirements.txt` is for.
2018-01-08T17:36:18.000012
Garrett
pythondev_help_Garrett_2018-01-08T17:36:18.000012
1,515,432,978.000012
28,214
pythondev
help
Alright, I was just trying to figure out a way to distribute a python application without freezing it an an exe.
2018-01-08T17:37:11.000085
Gregoria
pythondev_help_Gregoria_2018-01-08T17:37:11.000085
1,515,433,031.000085
28,215
pythondev
help
<@Davina> - it's all well and good to get it into a single table, then you'd completely jump out of python?
2018-01-08T18:25:34.000353
Cecille
pythondev_help_Cecille_2018-01-08T18:25:34.000353
1,515,435,934.000353
28,216
pythondev
help
No you could keep using Python. If you want
2018-01-08T18:39:57.000030
Davina
pythondev_help_Davina_2018-01-08T18:39:57.000030
1,515,436,797.00003
28,217
pythondev
help
looks like digital advertising data
2018-01-08T18:47:10.000094
Shaun
pythondev_help_Shaun_2018-01-08T18:47:10.000094
1,515,437,230.000094
28,218
pythondev
help
:stuck_out_tongue:
2018-01-08T18:47:12.000093
Shaun
pythondev_help_Shaun_2018-01-08T18:47:12.000093
1,515,437,232.000093
28,219
pythondev
help
<@Shaun>yup... exactly
2018-01-08T18:50:21.000031
Cecille
pythondev_help_Cecille_2018-01-08T18:50:21.000031
1,515,437,421.000031
28,220
pythondev
help
in terms of sticking with Python <@Davina> - what's the workflow look like? one function pumps the whole table across via cron job every morning? Then another runs that pulls unique values and inserts them into a table for each dimension column? Was hoping there was a library out there that could make life easier. bono...
2018-01-08T18:55:39.000204
Cecille
pythondev_help_Cecille_2018-01-08T18:55:39.000204
1,515,437,739.000204
28,221
pythondev
help
You might also consider pandas as an etl tool
2018-01-08T18:57:19.000482
Shaun
pythondev_help_Shaun_2018-01-08T18:57:19.000482
1,515,437,839.000482
28,222
pythondev
help
Unless your data starts getting bigger
2018-01-08T18:57:37.000232
Shaun
pythondev_help_Shaun_2018-01-08T18:57:37.000232
1,515,437,857.000232
28,223