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
Hi, I am using the multiprocessing library and found the shared state i have implemented is out of sync. My question is does using `multiprocessing.Value` to keep a counter and `multiprocessing.Lock` to acquire and release write access, work when applied on another process in another thread?
2019-05-05T13:22:12.123700
Pura
pythondev_help_Pura_2019-05-05T13:22:12.123700
1,557,062,532.1237
22,121
pythondev
help
I am new to python and programming in general. I am working on a project for my portfolio and am getting a little stuck. I'd like to first create a map and outline several communities within a metropolitan area. Then, enter demographic data (mostly using ACS data) for each of the communities and write a program that allows a user to select and/or rate important neighborhood characteristics and have it return some kind of visualization that represents which neighborhood would be a best fit (or top 3). Is this something that can be done in Python? I've been experimenting with matplotlib and geopandas, but am constantly learning about new libraries to use (want to try cenpy next). I know there are programs that already do this (ESRI live, work, locate) but I want to recreate this type of program to help myself learn. ANY tips or suggestions would be greatly appreciated!!! I'm working in google colab if that makes a difference. Thank you!
2019-05-05T15:03:51.130100
Toshia
pythondev_help_Toshia_2019-05-05T15:03:51.130100
1,557,068,631.1301
22,122
pythondev
help
Hi, is anyone here familiar on how AWS EB (application load balancer) interacts with a Flask instance that has a scheduler `from apscheduler.schedulers.background import BackgroundScheduler` in it? I seem to getting a lot of `sqlalchemy.exc.InvalidRequestError: Can't reconnect until invalid transaction is rolled back`, `RuntimeError: Working outside of application context.` or some jobs do not seem to run even though they I know they are queued `scheduler.print_jobs('default')`.
2019-05-06T01:28:35.134600
Philip
pythondev_help_Philip_2019-05-06T01:28:35.134600
1,557,106,115.1346
22,123
pythondev
help
probably you need to use `scoped_session` <https://docs.sqlalchemy.org/en/13/orm/contextual.html> regarding &gt; Working outside of application context <https://stackoverflow.com/questions/31444036/runtimeerror-working-outside-of-application-context> (is it about url_for for example?)
2019-05-06T02:36:56.134900
Susan
pythondev_help_Susan_2019-05-06T02:36:56.134900
1,557,110,216.1349
22,124
pythondev
help
Hey is it possible to use regex to remove all non-characters, except one symbol like `!`?
2019-05-06T02:40:37.135700
Conchita
pythondev_help_Conchita_2019-05-06T02:40:37.135700
1,557,110,437.1357
22,125
pythondev
help
Example
2019-05-06T02:40:51.135900
Conchita
pythondev_help_Conchita_2019-05-06T02:40:51.135900
1,557,110,451.1359
22,126
pythondev
help
```string = 'this$is@a]dream!' result = re.sub(r"\W", " ", string) print(result) &gt;&gt;&gt; this is a dream```
2019-05-06T02:42:17.137300
Conchita
pythondev_help_Conchita_2019-05-06T02:42:17.137300
1,557,110,537.1373
22,127
pythondev
help
How can I use regex to keep the `!`, so my print statement will return `this is a dream!`
2019-05-06T02:42:59.137900
Conchita
pythondev_help_Conchita_2019-05-06T02:42:59.137900
1,557,110,579.1379
22,128
pythondev
help
One way to do it is with a negative lookahead assertion, like `r"(?!!)\W"`. The parenthesized expression only matches if the following character is not `!`.
2019-05-06T02:51:21.140200
Sasha
pythondev_help_Sasha_2019-05-06T02:51:21.140200
1,557,111,081.1402
22,129
pythondev
help
```10.65.41.35 - - [2019-05-05 00:00:00.344] "POST //dw-seasdrt.com:9090/solr/pos_shard5_replica6/select HTTP/1.1" 200 258 "-" "Solr[org.apache.solr.client.solrj.impl.HttpSolrClient] 1.0" 7 10.65.40.241 - - [2019-05-05 00:00:00.368] "POST //dfw-afr3.prod.fdt.com:9090/solr/pos_shard5_replica6/select HTTP/1.1" 200 258 "-" "Solr[org.apache.solr.client.solrj.impl.HttpSolrClient] 1.0" 6``` I want to search for `10.65.41.35` and extract `shard5`
2019-05-06T02:51:22.140300
Lanelle
pythondev_help_Lanelle_2019-05-06T02:51:22.140300
1,557,111,082.1403
22,130
pythondev
help
how do i do that
2019-05-06T02:51:23.140500
Lanelle
pythondev_help_Lanelle_2019-05-06T02:51:23.140500
1,557,111,083.1405
22,131
pythondev
help
what do you mean in terms of extract?
2019-05-06T02:56:13.142800
Leida
pythondev_help_Leida_2019-05-06T02:56:13.142800
1,557,111,373.1428
22,132
pythondev
help
There's some wiggle room in how specific you want to get with the matching pattern, but one sample regex would be something like `r"^10\.65\.41\.35 .*?/pos_(shard\d+)_replica\d+/"`.
2019-05-06T02:56:14.143000
Sasha
pythondev_help_Sasha_2019-05-06T02:56:14.143000
1,557,111,374.143
22,133
pythondev
help
or if regex is bit unreadable to you you could do a nested search, search the ip then the shard
2019-05-06T02:57:25.143800
Leida
pythondev_help_Leida_2019-05-06T02:57:25.143800
1,557,111,445.1438
22,134
pythondev
help
You're the man <@Sasha> :taco:
2019-05-06T02:57:45.144300
Conchita
pythondev_help_Conchita_2019-05-06T02:57:45.144300
1,557,111,465.1443
22,135
pythondev
help
regarding &gt; Working outside of application context I encounter these within my scheduled jobs. Some of the said jobs would execute an email wherein I use the following for sending emails.```from flask_mail import Mail mail = Mail(app)``` Do you suppose the function does not have access to `flask_mail` but has access to the `db` instance from `db = SQLAlchemy(app)` in my `__init__.py` file?
2019-05-06T03:06:33.144700
Philip
pythondev_help_Philip_2019-05-06T03:06:33.144700
1,557,111,993.1447
22,136
pythondev
help
Are you by chance using `apscheduler` as well on a AWS EB deployment? I'm kind of confused as to how I should go about setting up a Background Scheduler using `apscheduler`
2019-05-06T03:09:34.144900
Philip
pythondev_help_Philip_2019-05-06T03:09:34.144900
1,557,112,174.1449
22,137
pythondev
help
Here is the current snippet as to how I setup my scheduler. I don't think this is the right way atm because the scheduler does not start up unless I try to access one of my endpoints. ```@app.before_first_request def initialize(): __yesterday = (datetime.datetime.utcnow() - datetime.timedelta(1)).strftime('%Y-%m-%d') scheduler = BackgroundScheduler( job_defaults={'misfire_grace_time': 15*60}, jobstores={'default': SQLAlchemyJobStore(url='sqlite:///jobs.sqlite')}) scheduler.start(paused=True) # scheduler.remove_all_jobs('default') scheduler.wakeup() scheduler.add_job( max_instances=1, func=foo, trigger='interval', coalesce=True, # hours=2, seconds=30, timezone='UTC', start_date=f'{__yesterday} 01:00:00', id='foo-id', replace_existing=True) scheduler.print_jobs('default') atexit.register(lambda: scheduler.shutdown())```
2019-05-06T03:11:13.145100
Philip
pythondev_help_Philip_2019-05-06T03:11:13.145100
1,557,112,273.1451
22,138
pythondev
help
This does the trick, but still have one minor issue. There is a hanging `'` at the end of my strings
2019-05-06T03:16:38.145500
Conchita
pythondev_help_Conchita_2019-05-06T03:16:38.145500
1,557,112,598.1455
22,139
pythondev
help
Is this something I can also remove using the same regex expression you helped me with above&gt;
2019-05-06T03:16:58.145700
Conchita
pythondev_help_Conchita_2019-05-06T03:16:58.145700
1,557,112,618.1457
22,140
pythondev
help
&gt; Are you by chance using `apscheduler` as well on a AWS EB deployment I don't think that AWS ALB can do any difference with any other deployment
2019-05-06T03:49:45.146000
Susan
pythondev_help_Susan_2019-05-06T03:49:45.146000
1,557,114,585.146
22,141
pythondev
help
as per initialization see <https://apscheduler.readthedocs.io/en/latest/userguide.html#configuring-the-scheduler>
2019-05-06T03:52:39.146200
Susan
pythondev_help_Susan_2019-05-06T03:52:39.146200
1,557,114,759.1462
22,142
pythondev
help
&gt; Can't reconnect until invalid transaction is rolled back if multiple threads are used, you need to use `scoped_session`, so connection would be per thread
2019-05-06T03:55:49.146400
Susan
pythondev_help_Susan_2019-05-06T03:55:49.146400
1,557,114,949.1464
22,143
pythondev
help
&gt; Working outside of application context can you post more of error message?
2019-05-06T03:56:16.146600
Susan
pythondev_help_Susan_2019-05-06T03:56:16.146600
1,557,114,976.1466
22,144
pythondev
help
I see, I thought that by using `from flask_sqlalchemy import SQLAlchemy`, all my sessions are scoped by default.
2019-05-06T03:57:15.146900
Philip
pythondev_help_Philip_2019-05-06T03:57:15.146900
1,557,115,035.1469
22,145
pythondev
help
&gt; Working outside of application context I seem to be getting the `_mysql_exceptions.OperationalError: (2006, 'MySQL server has gone away')` error for this one. Like you said, I should probably start by using `scoped_session`.
2019-05-06T04:00:51.147100
Philip
pythondev_help_Philip_2019-05-06T04:00:51.147100
1,557,115,251.1471
22,146
pythondev
help
Thanks for the pointers kind sir <@Susan> :taco:
2019-05-06T04:01:22.147300
Philip
pythondev_help_Philip_2019-05-06T04:01:22.147300
1,557,115,282.1473
22,147
pythondev
help
By chance, do you have a sample snippet wherein a scheduler fires up upon starting the flask application?
2019-05-06T04:03:21.147500
Philip
pythondev_help_Philip_2019-05-06T04:03:21.147500
1,557,115,401.1475
22,148
pythondev
help
nope, I don't use apscheduler, we use celery for that purpose
2019-05-06T04:04:05.147800
Susan
pythondev_help_Susan_2019-05-06T04:04:05.147800
1,557,115,445.1478
22,149
pythondev
help
Thanks, I'll take a look into Celery + Flask then.
2019-05-06T04:10:57.148000
Philip
pythondev_help_Philip_2019-05-06T04:10:57.148000
1,557,115,857.148
22,150
pythondev
help
<@Sasha> regex is hard to me.. could you help me with the for loop or something to do the search
2019-05-06T04:53:58.148800
Lanelle
pythondev_help_Lanelle_2019-05-06T04:53:58.148800
1,557,118,438.1488
22,151
pythondev
help
Hey guys, I'm relatively new to Python. I guess I know the basics and I can write some code - but just started with design patterns etc. Currently I'm working on an ETL project in which we take JSON files and send them into an Azure database. Each JSON has its own custom mapping of fields to Azure tables and columns. So I'm working with one big json_mapper.py file which has a bunch of if/elif/else statements to check which mapping has to be used. As I understand, this would be a good situation for a factory method. I'd like to refactor this to a nice and clean method, but to be honest I don't really know where to start. I've done some reading into factory methods, but the custom mapping per JSON, which is sometimes very custom, is the hardest part for me. I'm not really sure where to put that etc. Does anyone have any pointers for me? A direction to where I should / could start?
2019-05-06T05:26:01.152200
Dawn
pythondev_help_Dawn_2019-05-06T05:26:01.152200
1,557,120,361.1522
22,152
pythondev
help
<@Dawn> can you show a sample from your code?
2019-05-06T05:26:46.152800
Chester
pythondev_help_Chester_2019-05-06T05:26:46.152800
1,557,120,406.1528
22,153
pythondev
help
yeah sure. There's a json which has feedback question objects, and in those question objects there are also answer objects. So this is an example where those questions and answers are split out into two mssql tables. Prepare for ugly code
2019-05-06T05:27:45.153800
Dawn
pythondev_help_Dawn_2019-05-06T05:27:45.153800
1,557,120,465.1538
22,154
pythondev
help
None
2019-05-06T05:28:01.153900
Dawn
pythondev_help_Dawn_2019-05-06T05:28:01.153900
1,557,120,481.1539
22,155
pythondev
help
this is a snippet of the mapper, which gets called by a general 'transfer' script. it gets the mssql_connection and a list of docs as parameters from the parent script
2019-05-06T05:28:23.154600
Dawn
pythondev_help_Dawn_2019-05-06T05:28:23.154600
1,557,120,503.1546
22,156
pythondev
help
and well it actually works fine, it's just ugly because there's like 30 custom mappings and it's only becoming more
2019-05-06T05:30:24.155300
Dawn
pythondev_help_Dawn_2019-05-06T05:30:24.155300
1,557,120,624.1553
22,157
pythondev
help
What's the easiest way to find a free, unused port available for binding with pytest?
2019-05-06T05:30:37.155600
Jonas
pythondev_help_Jonas_2019-05-06T05:30:37.155600
1,557,120,637.1556
22,158
pythondev
help
I remember seeing a free port fixture around somewhere, but I cannot find it for the life of me
2019-05-06T05:30:49.156000
Jonas
pythondev_help_Jonas_2019-05-06T05:30:49.156000
1,557,120,649.156
22,159
pythondev
help
(yes, race conditions etc, but it's a lot better than what we have now)
2019-05-06T05:31:12.156600
Jonas
pythondev_help_Jonas_2019-05-06T05:31:12.156600
1,557,120,672.1566
22,160
pythondev
help
I hope this helps :slightly_smiling_face: <https://marshmallow.readthedocs.io/en/3.0/>
2019-05-06T05:33:59.158600
Philip
pythondev_help_Philip_2019-05-06T05:33:59.158600
1,557,120,839.1586
22,161
pythondev
help
<@Dawn> okay, so you think your code is ugly mostly because it violates the single responsibility principle, a lot :slightly_smiling_face: I see thee different blocks of code that should be extracted into their own functions: 1) `doc`, `question` and `answers` parsing logic - some fields are optional, some fields need to be converted, etc. 2) mapping between parsed `doc` fields and `target` fields 3) I/O, data insertion into the database
2019-05-06T05:39:47.162600
Chester
pythondev_help_Chester_2019-05-06T05:39:47.162600
1,557,121,187.1626
22,162
pythondev
help
Once you extract parsing logic into its own function, you'll be able to implement mapping as a static dictionary
2019-05-06T05:47:18.165800
Chester
pythondev_help_Chester_2019-05-06T05:47:18.165800
1,557,121,638.1658
22,163
pythondev
help
e.g. ``` MAPPED_FIELDS = { '_id': 'ID', 'createdAt': 'CreatedAt', ... } mapped = {} for key, value in parsed_doc.items(): mapped_key = MAPPED_FIELDS[key] mapped[mapped_key] = value ```
2019-05-06T05:48:42.167300
Chester
pythondev_help_Chester_2019-05-06T05:48:42.167300
1,557,121,722.1673
22,164
pythondev
help
viola, you now have a generic mapper function that only needs a mapping dictionary as input
2019-05-06T05:49:16.168000
Chester
pythondev_help_Chester_2019-05-06T05:49:16.168000
1,557,121,756.168
22,165
pythondev
help
Looks nice, thanks
2019-05-06T05:51:52.168100
Dawn
pythondev_help_Dawn_2019-05-06T05:51:52.168100
1,557,121,912.1681
22,166
pythondev
help
first, we dont know where the text comes from - im assuming you can get it line by line
2019-05-06T06:29:52.168400
Leida
pythondev_help_Leida_2019-05-06T06:29:52.168400
1,557,124,192.1684
22,167
pythondev
help
you dont need to get the shard if the ip is wrong so on each line you can call ```if "10.65.41.35" in line:```
2019-05-06T06:31:15.168600
Leida
pythondev_help_Leida_2019-05-06T06:31:15.168600
1,557,124,275.1686
22,168
pythondev
help
where `line` is the variable that contains the line of text
2019-05-06T06:31:35.168800
Leida
pythondev_help_Leida_2019-05-06T06:31:35.168800
1,557,124,295.1688
22,169
pythondev
help
next up you could get the location of the substring using the `find()` function
2019-05-06T06:33:46.169000
Leida
pythondev_help_Leida_2019-05-06T06:33:46.169000
1,557,124,426.169
22,170
pythondev
help
something like ```line.find("_shard")```
2019-05-06T06:34:13.169200
Leida
pythondev_help_Leida_2019-05-06T06:34:13.169200
1,557,124,453.1692
22,171
pythondev
help
that would give you the index for the _ character
2019-05-06T06:35:41.169400
Leida
pythondev_help_Leida_2019-05-06T06:35:41.169400
1,557,124,541.1694
22,172
pythondev
help
if you add 6 to it you should have the index for the shard number
2019-05-06T06:36:32.169600
Leida
pythondev_help_Leida_2019-05-06T06:36:32.169600
1,557,124,592.1696
22,173
pythondev
help
if you know there are less than 10 shards then you could just get the character from that location, if it can be longer then then you should search for the next occurance of _ and subtracting 1 from the index of it to get the index of the last number, then anything between those two is the shard number
2019-05-06T06:38:04.169800
Leida
pythondev_help_Leida_2019-05-06T06:38:04.169800
1,557,124,684.1698
22,174
pythondev
help
is the shard number even what you are looking for?
2019-05-06T06:38:16.170000
Leida
pythondev_help_Leida_2019-05-06T06:38:16.170000
1,557,124,696.17
22,175
pythondev
help
<@Leida> sure what would be the snippet
2019-05-06T06:43:42.170200
Lanelle
pythondev_help_Lanelle_2019-05-06T06:43:42.170200
1,557,125,022.1702
22,176
pythondev
help
``` if "10.65.41.35" in line: index = line.find("_shard") shard_number = line[index+6]```
2019-05-06T06:46:01.170400
Leida
pythondev_help_Leida_2019-05-06T06:46:01.170400
1,557,125,161.1704
22,177
pythondev
help
you can get an error if line is shorter than `index + 6` tho
2019-05-06T06:47:04.170600
Leida
pythondev_help_Leida_2019-05-06T06:47:04.170600
1,557,125,224.1706
22,178
pythondev
help
are u going to also have ```f=open('file','r') line=f.readlines()```
2019-05-06T06:50:26.170800
Lanelle
pythondev_help_Lanelle_2019-05-06T06:50:26.170800
1,557,125,426.1708
22,179
pythondev
help
`with open(“filename”) as file: `
2019-05-06T06:52:12.171000
Leida
pythondev_help_Leida_2019-05-06T06:52:12.171000
1,557,125,532.171
22,180
pythondev
help
``` with open("filename") as file: for line in file: if "10.65.41.35" in line: index = line.find("_shard") shard_number = line[index+6]```
2019-05-06T06:52:53.171200
Leida
pythondev_help_Leida_2019-05-06T06:52:53.171200
1,557,125,573.1712
22,181
pythondev
help
you can add checking if `_shard` was found (find returns -1 if not found) and check the length of line before you try to use an index on it and well maybe replace the 6 with `len("_shard")` so that there are no magic numbers
2019-05-06T06:58:52.171900
Leida
pythondev_help_Leida_2019-05-06T06:58:52.171900
1,557,125,932.1719
22,182
pythondev
help
I would like some help clarifying if I have a correct data model. My end goal is to have something that allows users to create their own data models for risks. Users should be able to make their own risk types and attach as many different fields as they like. I want to avoid having database tables that are called `automobiles`, `houses` etc. Fields would be stuff like `first name`, `age`, `serial number` etc i.e. anything the user would want to collect about the risk in question. Fields can be of different types e.g. `text`, `date`, `number`, `currency` etc.
2019-05-06T07:12:47.178900
Jamey
pythondev_help_Jamey_2019-05-06T07:12:47.178900
1,557,126,767.1789
22,183
pythondev
help
What would you do with that data?
2019-05-06T07:14:14.180200
Chester
pythondev_help_Chester_2019-05-06T07:14:14.180200
1,557,126,854.1802
22,184
pythondev
help
My model at present is as follows: A one to many relationship between `RiskType` and `FieldType`, then a one to many relationship between `Field` and `FieldType`.
2019-05-06T07:15:01.180900
Jamey
pythondev_help_Jamey_2019-05-06T07:15:01.180900
1,557,126,901.1809
22,185
pythondev
help
<@Chester> the idea is to use this to create an API where users can make their own risks that they'd like to be insured for.
2019-05-06T07:16:09.181900
Jamey
pythondev_help_Jamey_2019-05-06T07:16:09.181900
1,557,126,969.1819
22,186
pythondev
help
Okay, I repeat my question :slightly_smiling_face:
2019-05-06T07:16:52.182200
Chester
pythondev_help_Chester_2019-05-06T07:16:52.182200
1,557,127,012.1822
22,187
pythondev
help
Thanks, but with this there's still the problem of nested objects. I have a lot of those and they all look different. Sometimes it's even a nested doc in a nested doc in an array in a nested doc...
2019-05-06T07:17:23.182500
Dawn
pythondev_help_Dawn_2019-05-06T07:17:23.182500
1,557,127,043.1825
22,188
pythondev
help
I can rephrase: what would this api give me that a sticky notes app doesn't have?
2019-05-06T07:17:51.183100
Chester
pythondev_help_Chester_2019-05-06T07:17:51.183100
1,557,127,071.1831
22,189
pythondev
help
Write a separate parser/mapper for each nested doc.
2019-05-06T07:18:27.183200
Chester
pythondev_help_Chester_2019-05-06T07:18:27.183200
1,557,127,107.1832
22,190
pythondev
help
It gives me a use case where I write code that demonstrates my abilities to write an API using DRF. :slightly_smiling_face:
2019-05-06T07:34:41.185200
Jamey
pythondev_help_Jamey_2019-05-06T07:34:41.185200
1,557,128,081.1852
22,191
pythondev
help
I see
2019-05-06T07:35:09.185800
Chester
pythondev_help_Chester_2019-05-06T07:35:09.185800
1,557,128,109.1858
22,192
pythondev
help
Then pretty much anything would work
2019-05-06T07:35:14.186000
Chester
pythondev_help_Chester_2019-05-06T07:35:14.186000
1,557,128,114.186
22,193
pythondev
help
Yes, but that anything needs to be something that I can write up in an Entity Relationship Diagram.
2019-05-06T07:35:57.187200
Jamey
pythondev_help_Jamey_2019-05-06T07:35:57.187200
1,557,128,157.1872
22,194
pythondev
help
Maybe a JSONB field is easier to work with if your schema isn't strictly defined
2019-05-06T07:35:58.187300
Chester
pythondev_help_Chester_2019-05-06T07:35:58.187300
1,557,128,158.1873
22,195
pythondev
help
ER diagram only makes sense for strictly defined schemas
2019-05-06T07:36:19.187800
Chester
pythondev_help_Chester_2019-05-06T07:36:19.187800
1,557,128,179.1878
22,196
pythondev
help
I was just asking to make sure I had the relationships laid out correctly.
2019-05-06T07:36:34.188200
Jamey
pythondev_help_Jamey_2019-05-06T07:36:34.188200
1,557,128,194.1882
22,197
pythondev
help
The idea is that it should be strictly defined, yes. Or at least that's what is implied by asking for a ER diagram to go along with your classes.
2019-05-06T07:37:34.189300
Jamey
pythondev_help_Jamey_2019-05-06T07:37:34.189300
1,557,128,254.1893
22,198
pythondev
help
:thinking_face:
2019-05-06T07:37:43.189500
Chester
pythondev_help_Chester_2019-05-06T07:37:43.189500
1,557,128,263.1895
22,199
pythondev
help
How can you strictly define a schema if you allow users to change it as they wish?
2019-05-06T07:37:58.189900
Chester
pythondev_help_Chester_2019-05-06T07:37:58.189900
1,557,128,278.1899
22,200
pythondev
help
What you're looking for is <https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model>
2019-05-06T07:39:12.191000
Chester
pythondev_help_Chester_2019-05-06T07:39:12.191000
1,557,128,352.191
22,201
pythondev
help
I think the idea (as I understand it) is that you expose field types e.g. `text`, `numbers` etc to a user so that they can make their own field e.g. a `name` field of `text` type.
2019-05-06T07:40:07.191600
Jamey
pythondev_help_Jamey_2019-05-06T07:40:07.191600
1,557,128,407.1916
22,202
pythondev
help
Yes. I think it is what I am looking for. Thanks. :taco: <@Chester>. I'll start from there then.
2019-05-06T07:42:00.192500
Jamey
pythondev_help_Jamey_2019-05-06T07:42:00.192500
1,557,128,520.1925
22,203
pythondev
help
So Django is pretty damn good for this kind of thing <@Jamey>
2019-05-06T08:37:40.192900
Jonas
pythondev_help_Jonas_2019-05-06T08:37:40.192900
1,557,131,860.1929
22,204
pythondev
help
In a previous project we approached this with a `Question` model, which had a question and a response type
2019-05-06T08:37:59.193400
Jonas
pythondev_help_Jonas_2019-05-06T08:37:59.193400
1,557,131,879.1934
22,205
pythondev
help
What we did was make the `Question` class store a JSON field of form keyword arguments
2019-05-06T08:38:23.194000
Jonas
pythondev_help_Jonas_2019-05-06T08:38:23.194000
1,557,131,903.194
22,206
pythondev
help
Then, from a given `Question` you can construct a form field with the 'right' validations and types
2019-05-06T08:38:44.194500
Jonas
pythondev_help_Jonas_2019-05-06T08:38:44.194500
1,557,131,924.1945
22,207
pythondev
help
And, given `n` questions, you have a `Form` you can validate against
2019-05-06T08:38:58.194900
Jonas
pythondev_help_Jonas_2019-05-06T08:38:58.194900
1,557,131,938.1949
22,208
pythondev
help
This doesn't really work that well for ForeignKey fields, but for primitive types it worked excellently. We presented several forms that created the `Question` model with the right schema
2019-05-06T08:39:56.195800
Jonas
pythondev_help_Jonas_2019-05-06T08:39:56.195800
1,557,131,996.1958
22,209
pythondev
help
i.e a form with `max_length`, `min_value` etc. These are all just `**kwargs` to a `Field` instance. Once validated, we know they work, and can dynamically create a `Question` form at any time with `field_classes[field_type](**question_instance.args)`
2019-05-06T08:41:06.197400
Jonas
pythondev_help_Jonas_2019-05-06T08:41:06.197400
1,557,132,066.1974
22,210
pythondev
help
<@Jonas> :taco: for sharing. Will try this out too.
2019-05-06T09:12:56.197900
Jamey
pythondev_help_Jamey_2019-05-06T09:12:56.197900
1,557,133,976.1979
22,211
pythondev
help
Hello... I tried to restart the Network Manager on Ubuntu server LTS 18.04 after configuring network settings with netplan using the following command : `sudo systemctl restart NetworkManager`
2019-05-06T09:30:13.201200
Elmira
pythondev_help_Elmira_2019-05-06T09:30:13.201200
1,557,135,013.2012
22,212
pythondev
help
`error: Unit NetworkManager.service not found`
2019-05-06T09:30:57.202400
Elmira
pythondev_help_Elmira_2019-05-06T09:30:57.202400
1,557,135,057.2024
22,213
pythondev
help
Any help?
2019-05-06T09:31:05.202700
Elmira
pythondev_help_Elmira_2019-05-06T09:31:05.202700
1,557,135,065.2027
22,214
pythondev
help
might be `network-manager`
2019-05-06T09:31:31.202900
Holly
pythondev_help_Holly_2019-05-06T09:31:31.202900
1,557,135,091.2029
22,215
pythondev
help
<@Elmira>
2019-05-06T09:31:37.203100
Holly
pythondev_help_Holly_2019-05-06T09:31:37.203100
1,557,135,097.2031
22,216
pythondev
help
you can also double check in I believe `/etc/init.d/` with something like `ls /etc/init.d | grep -i network`
2019-05-06T09:32:17.203800
Holly
pythondev_help_Holly_2019-05-06T09:32:17.203800
1,557,135,137.2038
22,217
pythondev
help
Okay I will try it
2019-05-06T09:42:56.204300
Elmira
pythondev_help_Elmira_2019-05-06T09:42:56.204300
1,557,135,776.2043
22,218
pythondev
help
`systemctl list-units` should show you all of the services, you can check if it exists there
2019-05-06T09:43:13.204700
Leida
pythondev_help_Leida_2019-05-06T09:43:13.204700
1,557,135,793.2047
22,219
pythondev
help
Okay
2019-05-06T09:43:25.204900
Elmira
pythondev_help_Elmira_2019-05-06T09:43:25.204900
1,557,135,805.2049
22,220