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 you can send in a model representation via json from your client
2017-06-21T08:06:56.874251
Meg
pythondev_help_Meg_2017-06-21T08:06:56.874251
1,498,032,416.874251
82,603
pythondev
help
and it will deserialize it to a model instance which you can do more stuff with
2017-06-21T08:07:17.879131
Meg
pythondev_help_Meg_2017-06-21T08:07:17.879131
1,498,032,437.879131
82,604
pythondev
help
and then sending data back out to the client, it will serialize models to JSON
2017-06-21T08:07:33.883134
Meg
pythondev_help_Meg_2017-06-21T08:07:33.883134
1,498,032,453.883134
82,605
pythondev
help
ok nice, and just ajax post to the url view which receives the data
2017-06-21T08:08:08.891465
Holli
pythondev_help_Holli_2017-06-21T08:08:08.891465
1,498,032,488.891465
82,606
pythondev
help
correct
2017-06-21T08:08:22.894910
Meg
pythondev_help_Meg_2017-06-21T08:08:22.894910
1,498,032,502.89491
82,607
pythondev
help
or get, put, etc
2017-06-21T08:08:26.895940
Meg
pythondev_help_Meg_2017-06-21T08:08:26.895940
1,498,032,506.89594
82,608
pythondev
help
superb thanks man
2017-06-21T08:08:35.897910
Holli
pythondev_help_Holli_2017-06-21T08:08:35.897910
1,498,032,515.89791
82,609
pythondev
help
:thumbsup:
2017-06-21T08:08:40.899155
Meg
pythondev_help_Meg_2017-06-21T08:08:40.899155
1,498,032,520.899155
82,610
pythondev
help
:100:
2017-06-21T08:08:51.901851
Holli
pythondev_help_Holli_2017-06-21T08:08:51.901851
1,498,032,531.901851
82,611
pythondev
help
The ansible I linked has a `role/nginx` that has the nginx setup steps :)
2017-06-21T08:42:32.433269
Beula
pythondev_help_Beula_2017-06-21T08:42:32.433269
1,498,034,552.433269
82,612
pythondev
help
I'm evaluating celery/redis alternatives for task queuing and scheduling. Someone mentioned redislite and apscheduler. Does apscheduler do task queuing or just scheduling? Also, any other alternatives?
2017-06-21T09:09:14.933506
Rolland
pythondev_help_Rolland_2017-06-21T09:09:14.933506
1,498,036,154.933506
82,613
pythondev
help
This is being used for a Django environment.
2017-06-21T09:09:21.936149
Rolland
pythondev_help_Rolland_2017-06-21T09:09:21.936149
1,498,036,161.936149
82,614
pythondev
help
`concurrent.futures.ProcessPoolExecutor` is good at queuing when you don't need ETA scheduling
2017-06-21T09:11:14.974243
Collette
pythondev_help_Collette_2017-06-21T09:11:14.974243
1,498,036,274.974243
82,615
pythondev
help
So if I'm just firing off a task (not scheduling), that would be a good way to go?
2017-06-21T09:15:32.063476
Rolland
pythondev_help_Rolland_2017-06-21T09:15:32.063476
1,498,036,532.063476
82,616
pythondev
help
I like that.
2017-06-21T09:15:38.065593
Rolland
pythondev_help_Rolland_2017-06-21T09:15:38.065593
1,498,036,538.065593
82,617
pythondev
help
Redis-lite would be if you kept celery to make it easier to distribute, otherwise APScheduler could call manage.py commands in your app and be deadsimple
2017-06-21T09:18:33.126491
Beula
pythondev_help_Beula_2017-06-21T09:18:33.126491
1,498,036,713.126491
82,618
pythondev
help
ah. gotcha.
2017-06-21T09:19:58.157093
Rolland
pythondev_help_Rolland_2017-06-21T09:19:58.157093
1,498,036,798.157093
82,619
pythondev
help
I was looking at if there was maybe en embedded task queue manager, but I'm not coming up with much. APScheduler looks to be a good route.
2017-06-21T09:21:10.182734
Rolland
pythondev_help_Rolland_2017-06-21T09:21:10.182734
1,498,036,870.182734
82,620
pythondev
help
Can you fire off tasks immediately without scheduling them using apscheduler?
2017-06-21T09:21:42.194462
Rolland
pythondev_help_Rolland_2017-06-21T09:21:42.194462
1,498,036,902.194462
82,621
pythondev
help
Yeah I think the decorator returns the original function. So you could just call it directly iirc
2017-06-21T09:25:15.271654
Beula
pythondev_help_Beula_2017-06-21T09:25:15.271654
1,498,037,115.271654
82,622
pythondev
help
Interesting thought, embedded task queue manager. I think in many cases someone would just use Cron or windows scheduler
2017-06-21T09:26:10.291856
Beula
pythondev_help_Beula_2017-06-21T09:26:10.291856
1,498,037,170.291856
82,623
pythondev
help
True.
2017-06-21T09:29:24.364350
Rolland
pythondev_help_Rolland_2017-06-21T09:29:24.364350
1,498,037,364.36435
82,624
pythondev
help
<@Rolland> we're also using huey
2017-06-21T09:38:31.575313
Vada
pythondev_help_Vada_2017-06-21T09:38:31.575313
1,498,037,911.575313
82,625
pythondev
help
I was actually just looking at that one. Can you start it right from django?
2017-06-21T09:39:05.587549
Rolland
pythondev_help_Rolland_2017-06-21T09:39:05.587549
1,498,037,945.587549
82,626
pythondev
help
<@Vada> from an author of Peewee?
2017-06-21T09:44:28.711939
Suellen
pythondev_help_Suellen_2017-06-21T09:44:28.711939
1,498,038,268.711939
82,627
pythondev
help
<https://github.com/coleifer/huey>
2017-06-21T09:45:53.745451
Vada
pythondev_help_Vada_2017-06-21T09:45:53.745451
1,498,038,353.745451
82,628
pythondev
help
not sure if they authored peewee but maybe
2017-06-21T09:46:02.749104
Vada
pythondev_help_Vada_2017-06-21T09:46:02.749104
1,498,038,362.749104
82,629
pythondev
help
And what do you mean by start it from django?
2017-06-21T09:46:10.752285
Vada
pythondev_help_Vada_2017-06-21T09:46:10.752285
1,498,038,370.752285
82,630
pythondev
help
Well, I'd like to not have to run and manage extra processes.
2017-06-21T09:46:46.766691
Rolland
pythondev_help_Rolland_2017-06-21T09:46:46.766691
1,498,038,406.766691
82,631
pythondev
help
it will use workers like celery
2017-06-21T09:47:37.786961
Vada
pythondev_help_Vada_2017-06-21T09:47:37.786961
1,498,038,457.786961
82,632
pythondev
help
ah. ok.
2017-06-21T09:48:11.799955
Rolland
pythondev_help_Rolland_2017-06-21T09:48:11.799955
1,498,038,491.799955
82,633
pythondev
help
hello everyone, I've requirement where dataset is large like 10 millions records, i want to use django rest framework in order to provide that data. Question : which one is the best ORM which is efficient for large datasets? 1. Django ORM 2. SQL alchemy
2017-06-21T10:47:35.337872
Romona
pythondev_help_Romona_2017-06-21T10:47:35.337872
1,498,042,055.337872
82,634
pythondev
help
SQLalchemy is more performant especially if you're using Core.
2017-06-21T10:48:45.369425
Dave
pythondev_help_Dave_2017-06-21T10:48:45.369425
1,498,042,125.369425
82,635
pythondev
help
<@Dave> thanks for the suggestion. I've those data on microsoft SQL server.
2017-06-21T10:49:54.400579
Romona
pythondev_help_Romona_2017-06-21T10:49:54.400579
1,498,042,194.400579
82,636
pythondev
help
would like to move to postgresql.
2017-06-21T10:50:40.421233
Romona
pythondev_help_Romona_2017-06-21T10:50:40.421233
1,498,042,240.421233
82,637
pythondev
help
yeah, will be cheaper in the long run
2017-06-21T10:51:13.435676
Meg
pythondev_help_Meg_2017-06-21T10:51:13.435676
1,498,042,273.435676
82,638
pythondev
help
no sql server license :slightly_smiling_face:
2017-06-21T10:51:19.438332
Meg
pythondev_help_Meg_2017-06-21T10:51:19.438332
1,498,042,279.438332
82,639
pythondev
help
<@Romona> <http://docs.sqlalchemy.org/en/latest/faq/performance.html>
2017-06-21T10:51:23.440036
Dave
pythondev_help_Dave_2017-06-21T10:51:23.440036
1,498,042,283.440036
82,640
pythondev
help
how about django ORM? Not good from performance point of view?
2017-06-21T10:52:56.482672
Romona
pythondev_help_Romona_2017-06-21T10:52:56.482672
1,498,042,376.482672
82,641
pythondev
help
if you use sqlalchemy you can reflect your mssql database and then create its exact schema in postgres.
2017-06-21T10:53:00.484897
Johana
pythondev_help_Johana_2017-06-21T10:53:00.484897
1,498,042,380.484897
82,642
pythondev
help
and you could use sqlacodegen to create the models.
2017-06-21T10:53:48.506810
Johana
pythondev_help_Johana_2017-06-21T10:53:48.506810
1,498,042,428.50681
82,643
pythondev
help
i've done this very thing to move a .net application to python.
2017-06-21T10:54:18.520726
Johana
pythondev_help_Johana_2017-06-21T10:54:18.520726
1,498,042,458.520726
82,644
pythondev
help
I think "performance on large data sets" and "ORM" are mutually exclusive. ORMs exist for development convenience, not high performance.
2017-06-21T10:54:22.522493
Gabriele
pythondev_help_Gabriele_2017-06-21T10:54:22.522493
1,498,042,462.522493
82,645
pythondev
help
^
2017-06-21T10:54:29.525442
Meg
pythondev_help_Meg_2017-06-21T10:54:29.525442
1,498,042,469.525442
82,646
pythondev
help
and furthermore, you should use pagination and such to actually retrieve the data
2017-06-21T10:54:42.531611
Meg
pythondev_help_Meg_2017-06-21T10:54:42.531611
1,498,042,482.531611
82,647
pythondev
help
That's not to say you _can't_ get good performance - you can, if you know the ORM well and/or you have access to low level commands like SQLAlchemy Core
2017-06-21T10:54:45.532959
Gabriele
pythondev_help_Gabriele_2017-06-21T10:54:45.532959
1,498,042,485.532959
82,648
pythondev
help
Ultimate plan is this only. Move web API .Net to django API.
2017-06-21T10:54:53.536688
Romona
pythondev_help_Romona_2017-06-21T10:54:53.536688
1,498,042,493.536688
82,649
pythondev
help
But they're not designed for that purpose, and will probably impede you somewhat
2017-06-21T10:55:03.541345
Gabriele
pythondev_help_Gabriele_2017-06-21T10:55:03.541345
1,498,042,503.541345
82,650
pythondev
help
and there are times you will have to write and execute raw sql
2017-06-21T10:55:21.549778
Meg
pythondev_help_Meg_2017-06-21T10:55:21.549778
1,498,042,521.549778
82,651
pythondev
help
sqlalchemy's orm does a pretty good job in general.
2017-06-21T10:55:23.550854
Johana
pythondev_help_Johana_2017-06-21T10:55:23.550854
1,498,042,523.550854
82,652
pythondev
help
It depends a lot on the nature of the querying. If you have good indexing set up and you're only working with a few records at a time, the ORM usually doesn't care if there are 10, 10000, or 1000000 rows in a DB
2017-06-21T10:56:47.589390
Gabriele
pythondev_help_Gabriele_2017-06-21T10:56:47.589390
1,498,042,607.58939
82,653
pythondev
help
But if you're doing "big data" stuff where you routinely hit large amounts of the table... that's a different matter
2017-06-21T10:57:07.598358
Gabriele
pythondev_help_Gabriele_2017-06-21T10:57:07.598358
1,498,042,627.598358
82,654
pythondev
help
reducing joins helps a lot too
2017-06-21T10:57:17.602975
Winnifred
pythondev_help_Winnifred_2017-06-21T10:57:17.602975
1,498,042,637.602975
82,655
pythondev
help
yup, ORM joins are often nowhere near as efficient as raw SQL joins
2017-06-21T10:57:41.613681
Gabriele
pythondev_help_Gabriele_2017-06-21T10:57:41.613681
1,498,042,661.613681
82,656
pythondev
help
one thing I like about django is you can print out the sql query for a given db access
2017-06-21T10:58:33.637625
Meg
pythondev_help_Meg_2017-06-21T10:58:33.637625
1,498,042,713.637625
82,657
pythondev
help
and then look at it to see if you can improve it
2017-06-21T10:58:43.641838
Meg
pythondev_help_Meg_2017-06-21T10:58:43.641838
1,498,042,723.641838
82,658
pythondev
help
SQLAlchemy can do this too!
2017-06-21T10:58:46.643400
Suellen
pythondev_help_Suellen_2017-06-21T10:58:46.643400
1,498,042,726.6434
82,659
pythondev
help
by django, I mean the django framework, not the ORM
2017-06-21T10:59:09.653900
Meg
pythondev_help_Meg_2017-06-21T10:59:09.653900
1,498,042,749.6539
82,660
pythondev
help
since it is possible to replace the default ORM with sqlalchemy (though I've never done this), but the API is largely the same
2017-06-21T10:59:39.668295
Meg
pythondev_help_Meg_2017-06-21T10:59:39.668295
1,498,042,779.668295
82,661
pythondev
help
yea, you can mix sqlalchemy and django orm. it's all just python at the end of the day. however, if you swap out one for the other you lose all the benefits of the django orm and how it integrates with the framework.
2017-06-21T11:03:16.774301
Johana
pythondev_help_Johana_2017-06-21T11:03:16.774301
1,498,042,996.774301
82,662
pythondev
help
If performance is a factor than use SQLAlchemy core to work on this large data set. If deadlines are more of a factor that use Django ORM since you're already use DRF. Just make sure to use eager loading on relationships where you can to optimize queries. <http://ses4j.github.io/2015/11/23/optimizing-slow-django-rest-framework-performance/>
2017-06-21T11:08:04.904795
Dave
pythondev_help_Dave_2017-06-21T11:08:04.904795
1,498,043,284.904795
82,663
pythondev
help
any good tutorials you all would recommend on packaging for somebody who's never done it?
2017-06-21T11:25:24.365386
Willena
pythondev_help_Willena_2017-06-21T11:25:24.365386
1,498,044,324.365386
82,664
pythondev
help
how can i do this in python
2017-06-21T12:43:10.322890
Norris
pythondev_help_Norris_2017-06-21T12:43:10.322890
1,498,048,990.32289
82,665
pythondev
help
why don't you create store proc?
2017-06-21T12:44:15.347345
Romona
pythondev_help_Romona_2017-06-21T12:44:15.347345
1,498,049,055.347345
82,666
pythondev
help
how can i do that
2017-06-21T12:45:16.370807
Norris
pythondev_help_Norris_2017-06-21T12:45:16.370807
1,498,049,116.370807
82,667
pythondev
help
?
2017-06-21T12:45:18.371649
Norris
pythondev_help_Norris_2017-06-21T12:45:18.371649
1,498,049,118.371649
82,668
pythondev
help
<@Norris>, can you give more context around the error? Things like an overview of what you're trying to do, your input, the expected output and the current error you're receiving.
2017-06-21T12:48:46.450595
Winnifred
pythondev_help_Winnifred_2017-06-21T12:48:46.450595
1,498,049,326.450595
82,669
pythondev
help
in the comand like i get this error
2017-06-21T12:49:24.464172
Norris
pythondev_help_Norris_2017-06-21T12:49:24.464172
1,498,049,364.464172
82,670
pythondev
help
File "dev.py", line 18 SyntaxError: Non-ASCII character '\xc3' in file dev.py on line 19, but no encoding declared; see <http://python.org/dev/peps/pep-0263/> for details
2017-06-21T12:49:25.464860
Norris
pythondev_help_Norris_2017-06-21T12:49:25.464860
1,498,049,365.46486
82,671
pythondev
help
its a valid sql code
2017-06-21T12:49:40.470281
Norris
pythondev_help_Norris_2017-06-21T12:49:40.470281
1,498,049,380.470281
82,672
pythondev
help
and also valid python code
2017-06-21T12:50:02.478682
Norris
pythondev_help_Norris_2017-06-21T12:50:02.478682
1,498,049,402.478682
82,673
pythondev
help
what version of python are you using?
2017-06-21T12:53:21.553257
Winnifred
pythondev_help_Winnifred_2017-06-21T12:53:21.553257
1,498,049,601.553257
82,674
pythondev
help
<@Winnifred> its 2.7.12
2017-06-21T12:59:43.703058
Norris
pythondev_help_Norris_2017-06-21T12:59:43.703058
1,498,049,983.703058
82,675
pythondev
help
Okay, try declaring your source encoding by adding this to the top of your file:
2017-06-21T13:00:47.731282
Winnifred
pythondev_help_Winnifred_2017-06-21T13:00:47.731282
1,498,050,047.731282
82,676
pythondev
help
thanks
2017-06-21T13:02:32.773759
Norris
pythondev_help_Norris_2017-06-21T13:02:32.773759
1,498,050,152.773759
82,677
pythondev
help
worked
2017-06-21T13:02:36.775126
Norris
pythondev_help_Norris_2017-06-21T13:02:36.775126
1,498,050,156.775126
82,678
pythondev
help
but i dont get any data
2017-06-21T13:02:42.777418
Norris
pythondev_help_Norris_2017-06-21T13:02:42.777418
1,498,050,162.777418
82,679
pythondev
help
`cur.execute(query)` only executes your query. You will need to fetch the results.
2017-06-21T13:03:37.799344
Winnifred
pythondev_help_Winnifred_2017-06-21T13:03:37.799344
1,498,050,217.799344
82,680
pythondev
help
good stackoverflow reference to your encoding issue above:
2017-06-21T13:04:59.831091
Winnifred
pythondev_help_Winnifred_2017-06-21T13:04:59.831091
1,498,050,299.831091
82,681
pythondev
help
<https://stackoverflow.com/questions/10589620/syntaxerror-non-ascii-character-xa3-in-file-when-function-returns-%C2%A3>
2017-06-21T13:05:33.844532
Winnifred
pythondev_help_Winnifred_2017-06-21T13:05:33.844532
1,498,050,333.844532
82,682
pythondev
help
<@Yessenia> look at the `json` module
2017-06-21T14:02:36.171281
Ciera
pythondev_help_Ciera_2017-06-21T14:02:36.171281
1,498,053,756.171281
82,683
pythondev
help
That's invalid JSON - do you get that in an array instead?
2017-06-21T14:04:12.210473
Beula
pythondev_help_Beula_2017-06-21T14:04:12.210473
1,498,053,852.210473
82,684
pythondev
help
<@Beula> I get it while parsing a website, it's inside a html-table.
2017-06-21T14:24:18.677429
Yessenia
pythondev_help_Yessenia_2017-06-21T14:24:18.677429
1,498,055,058.677429
82,685
pythondev
help
<@Yessenia> what he’s saying is that format, when when parsed with the `json` module, will fail as its not valid JSON. you can check if it’s valid here: <http://www.jsoneditoronline.org/>
2017-06-21T14:34:29.923505
Patty
pythondev_help_Patty_2017-06-21T14:34:29.923505
1,498,055,669.923505
82,686
pythondev
help
<@Patty> Thanks
2017-06-21T14:37:32.995226
Yessenia
pythondev_help_Yessenia_2017-06-21T14:37:32.995226
1,498,055,852.995226
82,687
pythondev
help
Quite simple to fix, .split(',') then I have a list and something to work with :slightly_smiling_face:
2017-06-21T14:40:40.067556
Yessenia
pythondev_help_Yessenia_2017-06-21T14:40:40.067556
1,498,056,040.067556
82,688
pythondev
help
Not that simple, because `,` can be within a json block
2017-06-21T14:47:38.228517
Beula
pythondev_help_Beula_2017-06-21T14:47:38.228517
1,498,056,458.228517
82,689
pythondev
help
If you can garantee that format - it could be that simple and skip odd `,`'s, otherwise parsing matching brackets is a simple stack issue
2017-06-21T14:48:20.244630
Beula
pythondev_help_Beula_2017-06-21T14:48:20.244630
1,498,056,500.24463
82,690
pythondev
help
greatings
2017-06-21T15:21:10.986024
Norris
pythondev_help_Norris_2017-06-21T15:21:10.986024
1,498,058,470.986024
82,691
pythondev
help
how can i put this type of date format in a mysql query?
2017-06-21T15:21:30.992866
Norris
pythondev_help_Norris_2017-06-21T15:21:30.992866
1,498,058,490.992866
82,692
pythondev
help
2017-06-14 00:00:00
2017-06-21T15:21:31.993409
Norris
pythondev_help_Norris_2017-06-21T15:21:31.993409
1,498,058,491.993409
82,693
pythondev
help
date and time
2017-06-21T15:21:40.996088
Norris
pythondev_help_Norris_2017-06-21T15:21:40.996088
1,498,058,500.996088
82,694
pythondev
help
What have you tried?
2017-06-21T15:24:45.062062
Beula
pythondev_help_Beula_2017-06-21T15:24:45.062062
1,498,058,685.062062
82,695
pythondev
help
datetime.date(2017-06-14 00:00:00)
2017-06-21T15:26:54.108736
Norris
pythondev_help_Norris_2017-06-21T15:26:54.108736
1,498,058,814.108736
82,696
pythondev
help
import datetime
2017-06-21T15:27:02.111413
Norris
pythondev_help_Norris_2017-06-21T15:27:02.111413
1,498,058,822.111413
82,697
pythondev
help
Please format code with backticks around it
2017-06-21T15:27:45.127116
Beula
pythondev_help_Beula_2017-06-21T15:27:45.127116
1,498,058,865.127116
82,698
pythondev
help
what do you mean
2017-06-21T15:28:11.136246
Norris
pythondev_help_Norris_2017-06-21T15:28:11.136246
1,498,058,891.136246
82,699
pythondev
help
<https://get.slack.help/hc/en-us/articles/202288908-Format-your-messages#code-blocks>
2017-06-21T15:28:46.149322
Meg
pythondev_help_Meg_2017-06-21T15:28:46.149322
1,498,058,926.149322
82,700
pythondev
help
``` `code` ```
2017-06-21T15:28:47.149501
Beula
pythondev_help_Beula_2017-06-21T15:28:47.149501
1,498,058,927.149501
82,701
pythondev
help
That was unnecessarily hard :stuck_out_tongue:
2017-06-21T15:29:01.154558
Rolland
pythondev_help_Rolland_2017-06-21T15:29:01.154558
1,498,058,941.154558
82,702