Log file Viewer
Help
|
Karma
| Search:
#pil logs for Tuesday the 18th of June, 2013
(
Back to #pil overview
) (
Back to channel listing
) (
Animate logs
)
[
02:26:57
] <
wiredfool_
> ok, epicserve. This 1 character patch came to me when putting the littlest one to bed.
[
02:27:08
] <
wiredfool_
> https://bitbucket.org/david/django-storages/src/513c418116dd5a43a1160c0eb26c657a565dd960/storages/backends/s3boto.py?at=default#cl-419
[
02:27:20
] <
wiredfool_
> that line. change self.entries to self._entries
[
02:27:34
] <
wiredfool_
> try rerunning w/o your successful patch
[
02:28:30
] <
epicserve
> Hmmm… okay, I'll try that tomorrow.
[
02:28:52
] <
epicserve
> How on earth did you trace that down?
[
02:29:10
] <
wiredfool_
> by not thinking about it, and trying to get the little twit to go to sleep.
[
02:29:16
] <
epicserve
> Are you familiar with storages already?
[
02:29:16
] <
wiredfool_
> but really, the logic is:
[
02:29:25
] <
wiredfool_
> entries is a property
[
02:29:30
] <
wiredfool_
> _entries is the backing store
[
02:29:53
] <
wiredfool_
> if you access self.entries, it runs _get_entries, which does the big load
[
02:30:13
] <
wiredfool_
> which, you're doing to check if there's anything in entries, which defeats the purpose
[
02:30:31
] <
wiredfool_
> but, since we're in that class, we can access the backing store at _entries
[
02:31:01
] <
wiredfool_
> if it's the empty dict, which it should be
[
02:31:27
] <
wiredfool_
> if it hasn't already loaded, then it just goes on and does the direct check
[
02:31:35
] <
wiredfool_
> using key.exists()
[
02:31:58
] <
wiredfool_
> I've only seen storage as much as I've been helping you
[
02:32:35
] <
wiredfool_
> sorry, it's not _get_entries, it's @properties def entries)_
[
02:33:22
] <
wiredfool_
> here: https://bitbucket.org/david/django-storages/src/513c418116dd5a43a1160c0eb26c657a565dd960/storages/backends/s3boto.py?at=default#cl-291
[
02:34:35
] <
wiredfool_
> any, one character patches are my favorite magic
[
02:34:39
] <
wiredfool_
> anyway
[
02:37:20
] <
epicserve
> Cool, I'll try that tomorrow.