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 | The snarky answer to your original question is, "Yes, Python can do anything that any piece of software can do, including finding a string in a file."
The slightly more helpful answer for someone just getting started is, "Use the `readlines` method on the file object you're reading from, then iterate through the list ... | 2019-04-02T21:17:37.255000 | Carmen | pythondev_help_Carmen_2019-04-02T21:17:37.255000 | 1,554,239,857.255 | 16,721 |
pythondev | help | Ok, but is there a piece of code thats is like `linethestringison = readlineget("joe is cool")` | 2019-04-02T21:18:45.256400 | Rodrick | pythondev_help_Rodrick_2019-04-02T21:18:45.256400 | 1,554,239,925.2564 | 16,722 |
pythondev | help | For something like this, `for i, line in enumerate(myfile)` would work well. Match against the data in `line`, and `i` will be the corresponding line number. | 2019-04-02T21:18:59.256700 | Sasha | pythondev_help_Sasha_2019-04-02T21:18:59.256700 | 1,554,239,939.2567 | 16,723 |
pythondev | help | ok | 2019-04-02T21:19:07.256900 | Rodrick | pythondev_help_Rodrick_2019-04-02T21:19:07.256900 | 1,554,239,947.2569 | 16,724 |
pythondev | help | What does `enumerate` do? | 2019-04-02T21:20:17.257300 | Rodrick | pythondev_help_Rodrick_2019-04-02T21:20:17.257300 | 1,554,240,017.2573 | 16,725 |
pythondev | help | It takes a list/iterator/whatever and gives you both the item number and the item as a tuple. So `enumerate("foo")` would give you `(0, "f"), (1, "o"), (2, "o")`. | 2019-04-02T21:21:45.258700 | Sasha | pythondev_help_Sasha_2019-04-02T21:21:45.258700 | 1,554,240,105.2587 | 16,726 |
pythondev | help | Very handy when you want to keep track of a list index as well as access the data conveniently. | 2019-04-02T21:22:46.259800 | Sasha | pythondev_help_Sasha_2019-04-02T21:22:46.259800 | 1,554,240,166.2598 | 16,727 |
pythondev | help | You will need to define a function `readlineget` that takes your search string, does the searching process, and returns the line number. Python doesn't have a built-in function to do that. | 2019-04-02T21:23:02.260200 | Carmen | pythondev_help_Carmen_2019-04-02T21:23:02.260200 | 1,554,240,182.2602 | 16,728 |
pythondev | help | <@Sasha> Purely for my curiosity (and to avoid having to dig into the docs) do you know if enumerating a file object like that reads the entire file into a list, or if it uses a generator to do it lazily? | 2019-04-02T21:24:11.261300 | Carmen | pythondev_help_Carmen_2019-04-02T21:24:11.261300 | 1,554,240,251.2613 | 16,729 |
pythondev | help | It should be lazy, give or take some amount of buffering in the file I/O. | 2019-04-02T21:25:02.262100 | Sasha | pythondev_help_Sasha_2019-04-02T21:25:02.262100 | 1,554,240,302.2621 | 16,730 |
pythondev | help | About what I expected. Groovy. | 2019-04-02T21:25:21.262300 | Carmen | pythondev_help_Carmen_2019-04-02T21:25:21.262300 | 1,554,240,321.2623 | 16,731 |
pythondev | help | `enumerate` isn't in my normal toolkit, so I'm not familiar with its semantics. | 2019-04-02T21:25:59.263100 | Carmen | pythondev_help_Carmen_2019-04-02T21:25:59.263100 | 1,554,240,359.2631 | 16,732 |
pythondev | help | It's rarely required to solve a problem, but it'll often save you a line or two by eliminating manually incremented counter variables, etc. | 2019-04-02T21:29:05.264000 | Sasha | pythondev_help_Sasha_2019-04-02T21:29:05.264000 | 1,554,240,545.264 | 16,733 |
pythondev | help | Which is primarily what I'm thinking of, since I use those all the fecking time in my scripts. | 2019-04-02T21:29:55.264400 | Carmen | pythondev_help_Carmen_2019-04-02T21:29:55.264400 | 1,554,240,595.2644 | 16,734 |
pythondev | help | <@Sasha> Hey! how have you been | 2019-04-02T21:35:23.264800 | Marceline | pythondev_help_Marceline_2019-04-02T21:35:23.264800 | 1,554,240,923.2648 | 16,735 |
pythondev | help | Been a while | 2019-04-02T21:35:35.265000 | Marceline | pythondev_help_Marceline_2019-04-02T21:35:35.265000 | 1,554,240,935.265 | 16,736 |
pythondev | help | Just fine, thanks! | 2019-04-02T21:37:05.265900 | Sasha | pythondev_help_Sasha_2019-04-02T21:37:05.265900 | 1,554,241,025.2659 | 16,737 |
pythondev | help | hey guys, anyone know if you can get the request path from an HTTP request in Django REST Framework? Or maybe just using native python methodology? basically I have an API endpoint that requires authentication but I want to allow requests to it from one specific URL regardless of authentication | 2019-04-02T21:37:18.266200 | Frankie | pythondev_help_Frankie_2019-04-02T21:37:18.266200 | 1,554,241,038.2662 | 16,738 |
pythondev | help | so if the request to the API comes from my landing page URL I'd like to allow it even for users who aren't logged in | 2019-04-02T21:37:38.266700 | Frankie | pythondev_help_Frankie_2019-04-02T21:37:38.266700 | 1,554,241,058.2667 | 16,739 |
pythondev | help | but I don't know how to check for that URL in my python code. | 2019-04-02T21:37:54.267000 | Frankie | pythondev_help_Frankie_2019-04-02T21:37:54.267000 | 1,554,241,074.267 | 16,740 |
pythondev | help | <https://docs.djangoproject.com/en/2.1/ref/request-response/#django.http.HttpRequest.path> | 2019-04-02T21:49:11.267200 | Carmen | pythondev_help_Carmen_2019-04-02T21:49:11.267200 | 1,554,241,751.2672 | 16,741 |
pythondev | help | thanks Joe, got some help in the django channel | 2019-04-02T22:01:54.267500 | Frankie | pythondev_help_Frankie_2019-04-02T22:01:54.267500 | 1,554,242,514.2675 | 16,742 |
pythondev | help | FWIW request.path is the path it's headed to ... I needed `request.META['HTTP_REFERER']` and more specifically `request._request.META.get('HTTP_REFERER')` since it's a DRF request and not standard django HTTPRequest | 2019-04-02T22:03:07.268800 | Frankie | pythondev_help_Frankie_2019-04-02T22:03:07.268800 | 1,554,242,587.2688 | 16,743 |
pythondev | help | hi | 2019-04-03T00:57:52.269300 | Casandra | pythondev_help_Casandra_2019-04-03T00:57:52.269300 | 1,554,253,072.2693 | 16,744 |
pythondev | help | hi i got some issue with the output | 2019-04-03T00:58:46.269900 | Casandra | pythondev_help_Casandra_2019-04-03T00:58:46.269900 | 1,554,253,126.2699 | 16,745 |
pythondev | help | can soebody help | 2019-04-03T00:58:58.270300 | Casandra | pythondev_help_Casandra_2019-04-03T00:58:58.270300 | 1,554,253,138.2703 | 16,746 |
pythondev | help | We're all very helpful, but we need more information about the problem. | 2019-04-03T01:03:05.270800 | Sasha | pythondev_help_Sasha_2019-04-03T01:03:05.270800 | 1,554,253,385.2708 | 16,747 |
pythondev | help | “dict slice”, that is extract multiple values from a dictionary by providing multiple keys at a time.
Ex: sample_dict = {‘a’:1,’b’:2,’c’:3,’d’:4}
Normal retrieval method: print(sample_dict[‘a’]) – Output -à 1
New “dict slice” method : print(sample_dict[‘ab’] -Outputà [1,2] | 2019-04-03T01:19:15.271300 | Casandra | pythondev_help_Casandra_2019-04-03T01:19:15.271300 | 1,554,254,355.2713 | 16,748 |
pythondev | help | You could subclass `dict` in order to implement something like that, but it's not built in. | 2019-04-03T01:21:34.272000 | Sasha | pythondev_help_Sasha_2019-04-03T01:21:34.272000 | 1,554,254,494.272 | 16,749 |
pythondev | help | <@Hiroko> I ended up using flower for graphically viewing my tasks | 2019-04-03T01:40:51.272800 | Valeri | pythondev_help_Valeri_2019-04-03T01:40:51.272800 | 1,554,255,651.2728 | 16,750 |
pythondev | help | I've got a different problem now | 2019-04-03T01:41:02.273100 | Valeri | pythondev_help_Valeri_2019-04-03T01:41:02.273100 | 1,554,255,662.2731 | 16,751 |
pythondev | help | ```
order_utils.bulk_create_books.apply_async(
kwargs={
'user_id': self.context.get('request').user.id,
'book_list': book_list[start_index:start_index+maximum_batch_size],
'batch_size': maximum_batch_size,
},
)
``` | 2019-04-03T01:41:35.273300 | Valeri | pythondev_help_Valeri_2019-04-03T01:41:35.273300 | 1,554,255,695.2733 | 16,752 |
pythondev | help | That's how I try to queue my bulk create | 2019-04-03T01:42:23.273800 | Valeri | pythondev_help_Valeri_2019-04-03T01:42:23.273800 | 1,554,255,743.2738 | 16,753 |
pythondev | help | ```
b'{"detail":{"message":"<User: <mailto:a@b.com|a@b.com>> is not JSON serializable","code":"encode_error","extra":{}}}'}
``` | 2019-04-03T01:42:48.274100 | Valeri | pythondev_help_Valeri_2019-04-03T01:42:48.274100 | 1,554,255,768.2741 | 16,754 |
pythondev | help | That's what I get | 2019-04-03T01:42:53.274300 | Valeri | pythondev_help_Valeri_2019-04-03T01:42:53.274300 | 1,554,255,773.2743 | 16,755 |
pythondev | help | Been banging my head against the wall since yesterday about this | 2019-04-03T01:43:11.274800 | Valeri | pythondev_help_Valeri_2019-04-03T01:43:11.274800 | 1,554,255,791.2748 | 16,756 |
pythondev | help | <@Sasha> I tried this
sample_dict = {'a':1, 'b':2, 'c':3, 'd':4}
class Mapping:
def __init__(self, sample_dict):
self.grades = sample_dict
def __getitem__(self, key1, key2):
return self.grades[key1], self.grades[key2]
ta = Mapping(sample_dict)
print(ta.__getitem__('a','d')) | 2019-04-03T01:54:51.275300 | Casandra | pythondev_help_Casandra_2019-04-03T01:54:51.275300 | 1,554,256,491.2753 | 16,757 |
pythondev | help | Cool | 2019-04-03T01:58:15.275500 | Sasha | pythondev_help_Sasha_2019-04-03T01:58:15.275500 | 1,554,256,695.2755 | 16,758 |
pythondev | help | <@Sasha> But it is not expected O/P :disappointed: | 2019-04-03T01:59:50.276500 | Casandra | pythondev_help_Casandra_2019-04-03T01:59:50.276500 | 1,554,256,790.2765 | 16,759 |
pythondev | help | Oh? What output do you get? | 2019-04-03T02:00:34.276800 | Sasha | pythondev_help_Sasha_2019-04-03T02:00:34.276800 | 1,554,256,834.2768 | 16,760 |
pythondev | help | If like i give print(ta.__getitem__('ad')) | 2019-04-03T02:01:56.277900 | Casandra | pythondev_help_Casandra_2019-04-03T02:01:56.277900 | 1,554,256,916.2779 | 16,761 |
pythondev | help | i need to get (1,2) | 2019-04-03T02:02:52.278600 | Casandra | pythondev_help_Casandra_2019-04-03T02:02:52.278600 | 1,554,256,972.2786 | 16,762 |
pythondev | help | i am getting Typeerroe | 2019-04-03T02:03:39.279900 | Casandra | pythondev_help_Casandra_2019-04-03T02:03:39.279900 | 1,554,257,019.2799 | 16,763 |
pythondev | help | Oh, yeah, that won't work because `__getitem__` is expecting 2 parameters. If you want to pass in a single string like that, you'd want to change the function to `__getitem__(self, key)` and use `key[0]` and `key[1]`, etc. | 2019-04-03T02:03:49.280200 | Sasha | pythondev_help_Sasha_2019-04-03T02:03:49.280200 | 1,554,257,029.2802 | 16,764 |
pythondev | help | (I'm slightly surprised at the TypeError, since I would have expected another exception, but maybe your code is a little different than was posted.) | 2019-04-03T02:06:09.281200 | Sasha | pythondev_help_Sasha_2019-04-03T02:06:09.281200 | 1,554,257,169.2812 | 16,765 |
pythondev | help | <@Sasha> Got it.:thankyou: | 2019-04-03T02:11:21.282200 | Casandra | pythondev_help_Casandra_2019-04-03T02:11:21.282200 | 1,554,257,481.2822 | 16,766 |
pythondev | help | Now I need to modify the code. This will take only two keys. | 2019-04-03T02:13:11.283400 | Casandra | pythondev_help_Casandra_2019-04-03T02:13:11.283400 | 1,554,257,591.2834 | 16,767 |
pythondev | help | If i give f like i give print(ta.__getitem__('a')) --> O/p is (1) | 2019-04-03T02:14:58.284700 | Casandra | pythondev_help_Casandra_2019-04-03T02:14:58.284700 | 1,554,257,698.2847 | 16,768 |
pythondev | help | If i give like print(ta.__getitem__('ad')) --> O/p is ('1','2')
If i give like print(ta.__getitem__('adc'))--> O/p is ('1','2','3')
If i give like print(ta.__getitem__('adcd'))-> O/p is ('1','2','3','4') | 2019-04-03T02:17:08.286600 | Casandra | pythondev_help_Casandra_2019-04-03T02:17:08.286600 | 1,554,257,828.2866 | 16,769 |
pythondev | help | You'll want to have a `for` loop, then. :grin: | 2019-04-03T02:18:04.287200 | Sasha | pythondev_help_Sasha_2019-04-03T02:18:04.287200 | 1,554,257,884.2872 | 16,770 |
pythondev | help | Hi, looking for help with a django project we have that was designed kind of bad and we need to test what we got. We have a django view that inside the view it's uses a class that send request to external service. I'm looking on how to swap the class call | 2019-04-03T03:08:54.288800 | Rayford | pythondev_help_Rayford_2019-04-03T03:08:54.288800 | 1,554,260,934.2888 | 16,771 |
pythondev | help | I'm been trying to do something like:
```
join = Join()
foo = join .post(request=json.dumps({
'foo': 'bar'
}))
print(foo)
```
and getting
```
json_serialized = self.serializer_class(data=request.data)
AttributeError: 'str' object has no attribute 'data'
``` | 2019-04-03T03:09:53.289700 | Rayford | pythondev_help_Rayford_2019-04-03T03:09:53.289700 | 1,554,260,993.2897 | 16,772 |
pythondev | help | So.. How to pass to a django view a request object via test? | 2019-04-03T03:11:14.290300 | Rayford | pythondev_help_Rayford_2019-04-03T03:11:14.290300 | 1,554,261,074.2903 | 16,773 |
pythondev | help | What is Join? | 2019-04-03T03:12:23.290500 | Valeri | pythondev_help_Valeri_2019-04-03T03:12:23.290500 | 1,554,261,143.2905 | 16,774 |
pythondev | help | Is join the view that you're talking about? | 2019-04-03T03:12:56.290900 | Valeri | pythondev_help_Valeri_2019-04-03T03:12:56.290900 | 1,554,261,176.2909 | 16,775 |
pythondev | help | Join is the view | 2019-04-03T03:14:05.291100 | Rayford | pythondev_help_Rayford_2019-04-03T03:14:05.291100 | 1,554,261,245.2911 | 16,776 |
pythondev | help | It look like this:
```
class Join(GenericAPIView):
permission_classes = (AllowAny,)
serializer_class = Serializer
def post(self, request):
json_serialized = self.serializer_class(data=request.data)
``` | 2019-04-03T03:15:07.292500 | Rayford | pythondev_help_Rayford_2019-04-03T03:15:07.292500 | 1,554,261,307.2925 | 16,777 |
pythondev | help | It's a poorly designed project and now we start to fix it | 2019-04-03T03:15:31.293100 | Rayford | pythondev_help_Rayford_2019-04-03T03:15:31.293100 | 1,554,261,331.2931 | 16,778 |
pythondev | help | Well, `json.dumps` returns a `string`, so that won't work.
You'd want to read about testing in Django. But in a few words: inherit your test class from `django.test.TestCase` and then do `<http://self.client.post|self.client.post>({'foo': 'bar'})` it will return you a response object where you can inspect response code... | 2019-04-03T03:20:21.296500 | Russ | pythondev_help_Russ_2019-04-03T03:20:21.296500 | 1,554,261,621.2965 | 16,779 |
pythondev | help | Views should be called using `as_view` | 2019-04-03T03:21:51.297400 | Valeri | pythondev_help_Valeri_2019-04-03T03:21:51.297400 | 1,554,261,711.2974 | 16,780 |
pythondev | help | <@Russ> Yes, I'm doing that in another place but since I want to swap an inner class that the view call I cannot use the client of django | 2019-04-03T03:21:55.297700 | Rayford | pythondev_help_Rayford_2019-04-03T03:21:55.297700 | 1,554,261,715.2977 | 16,781 |
pythondev | help | I meant there are other ways to do this ofcourse | 2019-04-03T03:22:06.297900 | Valeri | pythondev_help_Valeri_2019-04-03T03:22:06.297900 | 1,554,261,726.2979 | 16,782 |
pythondev | help | But `as_view` has served me the best tbh | 2019-04-03T03:22:25.298400 | Valeri | pythondev_help_Valeri_2019-04-03T03:22:25.298400 | 1,554,261,745.2984 | 16,783 |
pythondev | help | <https://stackoverflow.com/a/14957571/6403406> | 2019-04-03T03:22:50.298800 | Valeri | pythondev_help_Valeri_2019-04-03T03:22:50.298800 | 1,554,261,770.2988 | 16,784 |
pythondev | help | But how can I invoke the post class? | 2019-04-03T03:22:55.299100 | Rayford | pythondev_help_Rayford_2019-04-03T03:22:55.299100 | 1,554,261,775.2991 | 16,785 |
pythondev | help | post action* | 2019-04-03T03:23:05.299400 | Rayford | pythondev_help_Rayford_2019-04-03T03:23:05.299400 | 1,554,261,785.2994 | 16,786 |
pythondev | help | That's what I'm talking about | 2019-04-03T03:23:05.299500 | Valeri | pythondev_help_Valeri_2019-04-03T03:23:05.299500 | 1,554,261,785.2995 | 16,787 |
pythondev | help | `View.as_view({'post': 'post'})(request)` should probably work | 2019-04-03T03:24:19.300300 | Valeri | pythondev_help_Valeri_2019-04-03T03:24:19.300300 | 1,554,261,859.3003 | 16,788 |
pythondev | help | And request should be the payload I'm testing? | 2019-04-03T03:25:31.300600 | Rayford | pythondev_help_Rayford_2019-04-03T03:25:31.300600 | 1,554,261,931.3006 | 16,789 |
pythondev | help | request is an `HttpRequest` object | 2019-04-03T03:30:43.301200 | Valeri | pythondev_help_Valeri_2019-04-03T03:30:43.301200 | 1,554,262,243.3012 | 16,790 |
pythondev | help | Like that `foo = Join.as_view({'post': 'post'})({'foo': 'bar'})`? | 2019-04-03T03:30:48.301300 | Rayford | pythondev_help_Rayford_2019-04-03T03:30:48.301300 | 1,554,262,248.3013 | 16,791 |
pythondev | help | Nope | 2019-04-03T03:30:58.301500 | Valeri | pythondev_help_Valeri_2019-04-03T03:30:58.301500 | 1,554,262,258.3015 | 16,792 |
pythondev | help | The payload goes in as keyword args | 2019-04-03T03:31:09.301800 | Valeri | pythondev_help_Valeri_2019-04-03T03:31:09.301800 | 1,554,262,269.3018 | 16,793 |
pythondev | help | Oh wow | 2019-04-03T03:32:13.302200 | Valeri | pythondev_help_Valeri_2019-04-03T03:32:13.302200 | 1,554,262,333.3022 | 16,794 |
pythondev | help | Your `post` does not accept `kwargs` | 2019-04-03T03:32:26.302600 | Valeri | pythondev_help_Valeri_2019-04-03T03:32:26.302600 | 1,554,262,346.3026 | 16,795 |
pythondev | help | Well you'll have to make an `HttpRequest` object and pass your payload inside the `data` attribute of the object | 2019-04-03T03:33:11.303700 | Valeri | pythondev_help_Valeri_2019-04-03T03:33:11.303700 | 1,554,262,391.3037 | 16,796 |
pythondev | help | :S | 2019-04-03T03:33:24.304200 | Rayford | pythondev_help_Rayford_2019-04-03T03:33:24.304200 | 1,554,262,404.3042 | 16,797 |
pythondev | help | I'm pretty knew to django and kind of conused. Any change for an example on how to do that in a test? This is what I'm trying to achieve here | 2019-04-03T03:34:17.305300 | Rayford | pythondev_help_Rayford_2019-04-03T03:34:17.305300 | 1,554,262,457.3053 | 16,798 |
pythondev | help | In a method in a class I want to create a new object of the same class. Is there a better way than self.__class__(...)? | 2019-04-03T03:52:49.306600 | Dominique | pythondev_help_Dominique_2019-04-03T03:52:49.306600 | 1,554,263,569.3066 | 16,799 |
pythondev | help | Any help? I'm pretty lost here | 2019-04-03T04:11:15.307100 | Rayford | pythondev_help_Rayford_2019-04-03T04:11:15.307100 | 1,554,264,675.3071 | 16,800 |
pythondev | help | <@Rayford> <https://www.django-rest-framework.org/api-guide/testing/> | 2019-04-03T04:15:27.307400 | Valeri | pythondev_help_Valeri_2019-04-03T04:15:27.307400 | 1,554,264,927.3074 | 16,801 |
pythondev | help | This should really help you | 2019-04-03T04:15:35.307800 | Valeri | pythondev_help_Valeri_2019-04-03T04:15:35.307800 | 1,554,264,935.3078 | 16,802 |
pythondev | help | `self.__class__` will work with inheritance so that's the best way afaik | 2019-04-03T04:18:02.307900 | Jimmy | pythondev_help_Jimmy_2019-04-03T04:18:02.307900 | 1,554,265,082.3079 | 16,803 |
pythondev | help | <https://stackoverflow.com/a/11887308/6403406> | 2019-04-03T04:18:31.308700 | Valeri | pythondev_help_Valeri_2019-04-03T04:18:31.308700 | 1,554,265,111.3087 | 16,804 |
pythondev | help | or this? | 2019-04-03T04:18:34.309000 | Valeri | pythondev_help_Valeri_2019-04-03T04:18:34.309000 | 1,554,265,114.309 | 16,805 |
pythondev | help | <@Valeri> But test an http request. I'm trying to pass a request object to a view class | 2019-04-03T04:18:41.309200 | Rayford | pythondev_help_Rayford_2019-04-03T04:18:41.309200 | 1,554,265,121.3092 | 16,806 |
pythondev | help | Since the logic which interact with external service is in the view it self | 2019-04-03T04:19:15.309700 | Rayford | pythondev_help_Rayford_2019-04-03T04:19:15.309700 | 1,554,265,155.3097 | 16,807 |
pythondev | help | They did not wrote a class that holds all the logic for that | 2019-04-03T04:19:27.310100 | Rayford | pythondev_help_Rayford_2019-04-03T04:19:27.310100 | 1,554,265,167.3101 | 16,808 |
pythondev | help | So i'm trinng to do this:
```
def test_tidepool_clinic_does_not_exists(self):
# Create an instance of a GET request.
factory = APIRequestFactory()
request = <http://factory.post|factory.post>('/api/join/', {'title': 'new idea'})
clinic = Join()
<http://clinic.post|clinic.post... | 2019-04-03T04:20:19.310700 | Rayford | pythondev_help_Rayford_2019-04-03T04:20:19.310700 | 1,554,265,219.3107 | 16,809 |
pythondev | help | And get `AttributeError: 'WSGIRequest' object has no attribute 'data'` | 2019-04-03T04:20:32.311000 | Rayford | pythondev_help_Rayford_2019-04-03T04:20:32.311000 | 1,554,265,232.311 | 16,810 |
pythondev | help | So i tried to pass the request as an httprequest object but did not found how to set up a post example | 2019-04-03T04:21:12.311800 | Rayford | pythondev_help_Rayford_2019-04-03T04:21:12.311800 | 1,554,265,272.3118 | 16,811 |
pythondev | help | It's like a view interact with twitter and now I need to replace the twitter calss with my class | 2019-04-03T04:23:17.312600 | Rayford | pythondev_help_Rayford_2019-04-03T04:23:17.312600 | 1,554,265,397.3126 | 16,812 |
pythondev | help | <@Rayford> I highly recommend you go through: <https://docs.djangoproject.com/en/2.1/topics/testing/tools/> | 2019-04-03T04:25:46.313000 | Valeri | pythondev_help_Valeri_2019-04-03T04:25:46.313000 | 1,554,265,546.313 | 16,813 |
pythondev | help | And the previous page of the documentation if you've got time | 2019-04-03T04:26:11.313500 | Valeri | pythondev_help_Valeri_2019-04-03T04:26:11.313500 | 1,554,265,571.3135 | 16,814 |
pythondev | help | When user clicks start, app should start recording from camera, and when user click stop app should stop recording from camera. | 2019-04-03T04:55:16.313600 | Luise | pythondev_help_Luise_2019-04-03T04:55:16.313600 | 1,554,267,316.3136 | 16,815 |
pythondev | help | Now question is - I would like to set a variable(`self.abort_reading`) to true/false based on the basis of type of button click. | 2019-04-03T04:56:42.315200 | Luise | pythondev_help_Luise_2019-04-03T04:56:42.315200 | 1,554,267,402.3152 | 16,816 |
pythondev | help | How can I share/pass a variable between two processes? | 2019-04-03T04:57:16.315800 | Luise | pythondev_help_Luise_2019-04-03T04:57:16.315800 | 1,554,267,436.3158 | 16,817 |
pythondev | help | <@Valeri> <https://denibertovic.com/posts/celery-best-practices/>
Look at number 7 | 2019-04-03T06:39:45.316600 | Hiroko | pythondev_help_Hiroko_2019-04-03T06:39:45.316600 | 1,554,273,585.3166 | 16,818 |
pythondev | help | >>> Don't pass Database/ORM objects to tasks
You shouldn't pass Database objects (for instance your User model) to a background task because the serialized object might contain stale data. What you want to do is feed the task the User id and have the task ask the database for a fresh User object | 2019-04-03T06:40:32.316900 | Hiroko | pythondev_help_Hiroko_2019-04-03T06:40:32.316900 | 1,554,273,632.3169 | 16,819 |
pythondev | help | I figured that out <@Hiroko> | 2019-04-03T06:41:39.317500 | Valeri | pythondev_help_Valeri_2019-04-03T06:41:39.317500 | 1,554,273,699.3175 | 16,820 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.