2008-7-21
| 04:35 | brosner | just need to do it right, which i haven't spent time on |
| 04:35 | Alex_Gaynor | Oh, I read this as being how doc/ is hard coded, not root_path itself |
| 04:36 | brosner | yeah check each documentation view and see their root_path calculation |
| 04:36 | brosner | i think you will see immediately how to fix it |
| 04:37 | Alex_Gaynor | Ok, I see, sorry that was dumb |
| 04:37 | brosner | :) |
| 04:38 | Alex_Gaynor | The solution is to use the URLconf as I've suggested :D |
| 04:39 | Alex_Gaynor | #6470 ;) |
| 04:39 | DjangoBot | |
| 11:11 | david`bgk | hey Gulopine, awesome patch! |
| 11:12 | david`bgk | I'm updating S3Storage right now, do you have some time? |
| 11:19 | Gulopine | a little time, yeah |
| 11:20 | Gulopine | i have to leave for work in about 25 minutes |
| 11:22 | Gulopine | how's it working out for you? |
| 11:22 | david`bgk | ok, in File._get_size() it seems that you don't look at storage.size ? |
| 11:22 | Gulopine checks | |
| 11:23 | david`bgk | or maybe I miss something |
| 11:23 | david`bgk | but when I try obj1.normal.size, it raises an error |
| 11:23 | Gulopine | hrm, no, you're right |
| 11:24 | Gulopine | i had started making a StorageFile that would stash a reference to the storage system, but i pulled it out |
| 11:24 | Gulopine | i wasn't sure how best to do it and make it useful as a base for all backends |
| 11:25 | Gulopine | i think our best bet would be to have the backend provide a File subclass directly |
| 11:25 | david`bgk | ok, another issue with storages and open(), for the moment open() is located in FileSystemStorage, I propose to move it to Storage or maybe I should inherit from FileSystemStorage? |
| 11:25 | david`bgk | otherwise you can't just define _open() |
| 11:25 | Gulopine | ! |
| 11:25 | Gulopine | damn, you're right :( |
| 11:25 | Gulopine fixes that | |
| 11:26 | Gulopine | cause no, you shouldn't have to subclass FileSystemStorage, that's just asking for problems :) |
| 11:26 | david`bgk | yes :) |
| 11:27 | david`bgk | about backend providing a File subclass, how do you thing it should be done? |
| 11:27 | Gulopine | you can move it in your local copy, so you can keep going, but i'm updating the patch too |
| 11:27 | david`bgk | ok, that's what I had done |
| 11:28 | Gulopine | you should be able to just override __init__, size, those kinds of things as you need, then return an instance of that from _open() |
| 11:28 | Gulopine | but if you think it'd be easier to come up with a StorageFile, that's cool too |
| 11:29 | Gulopine | i just thought with the whole acts-like-a-file thing, that it'd be easier for the backend to provide a more customized File that accesses the backend directly, rather than having to blindly pass through to self.storage |
| 11:30 | Gulopine | i was thinking that'd get really tough to do generically when you have to allow multiple calls to .read(), for instance |
| 11:30 | david`bgk | ok I understand and I agree |
| 11:30 | david`bgk | I'll subclass RemoteFile |
| 11:31 | Gulopine | let me know how that works out, i'm getting more and more hesitant about subclassing StringIO |
| 11:32 | Gulopine | when using cStringIO, it doesn't behave exactly like a standard class, so things might get tricky |
| 11:36 | Gulopine | i suppose it'd be easy enough to provide a mostly-there StorageFile, covering things like size and url, but not open(), read(), write() and close() |
| 11:37 | Gulopine | leaving things like chunked reads and optional buffered writes up to the backend |
| 11:37 | david`bgk | ok |
| 11:37 | Gulopine | the one-off features (size, url, etc) are easy enough to add on a base class and have them Just Work |
| 11:41 | Gulopine | i'll get to work on updating that tonight |
| 11:41 | Gulopine | i gotta head off to work now though |
| 11:46 | reppel | Hi, s validators_list actually working? |
| 17:20 | gdoubleu_ | jacobkm: might be time to update the "When will you release Django 1.0?" FAQ :) |
| 17:20 | jacobkm | gdoubleu_: probably yeah, but not today I don't think. |
| 17:20 | jacobkm | gdoubleu_: can you open a ticket so I don't forget? |
| 17:21 | gdoubleu_ | jacobkm: sure thing |
| 17:26 | jhenry | On Friday, I coded up an implementation of a single related object descriptor cache that versions model classes and achieved a huge performance boost on my app. I'd like to give the code back, but I'm not sure if it's in a form that would be generally usable for the community at large. |
| 17:27 | jhenry | There are two components: 1. a set of signals on post_delete and post_save to increment a memcache key for a given model class (version number). |
| 17:27 | jhenry | 2. A lookup in the singlerelatedobjectdescriptor class and reversesinglerelatedobjectdescriptor that references the class version and primary key to reduce repeated queries for the same objects. |
| 17:28 | jhenry | since the version number is incremented on every save and delete, the cache will never be stale. |
| 17:28 | ubernostrum writes notes. | |
| 17:28 | jacobkm | jhenry: sounds neat. |
| 17:29 | cramm | jacobkm: re: last call for the alpha: Are the handgul of tickets marked as 2070-fix worth being considered before it's tagged? |
| 17:29 | cramm | *handful |
| 17:29 | jhenry | Given the dependence on a fast and large automatically-invalidating cache (memcached), I'm not quite sure how best to integrate it. It could certainly be enabled by a settings switch. |
| 17:29 | jacobkm | cramm: I'll take a look, but I think they're OK to be fixed in the next weeks... the alpha's really a snapshot release made to force us to get certain things done in certain order. |
| 17:30 | cramm | ok, np. Just wanted to be sure I raised the issue just in case |
| 17:33 | tux21b | we are using django svn and we get lots of duplicate entry bugs and editing isn't always possible, because django executes an INSERT instead of an UPDATE |
| 17:33 | tux21b | is this bug already known? |
| 17:45 | cramm | tux21b: you may want to search for it in Django Trac and open a ticket if you don't find it already reported, together with a minimal test case that shows it's really a Django bug and details about database backend, etc. |
| 17:46 | tux21b | cramm, i am quite busy now, but i will do it. its urgent :) |
| 17:47 | ubernostrum | tux21b: without any further information it is impossible to judge whether you found a bug in Django, or a bug in your own code. |
| 17:49 | tux21b | hmm... even "a = Article.objects.get(id=5); a.save()" executes an insert. pk is set here, mysql is the backend and save_base() or Model.save(a) doesn't work either |
| 17:49 | tux21b | and i get it in nearly every django model |
| 17:49 | tux21b | (but not with every instance...) |
| 17:51 | ubernostrum | And have you overridden save() on these models? |
| 17:56 | tux21b | |
| 17:57 | tux21b | yes, some are overridden and others are not. and even Model.save and save_base doesn't work |
| 17:58 | ubernostrum | Do you have any custom managers on these models? |
| 17:59 | tux21b | just this, i think that can't be the reason: http://paste.pocoo.org/show/79990/ |
| 18:00 | tux21b | and the bug isn't there that long, but i can't tell you the time, because we aren't updating all the time |
| 18:01 | tux21b | is there something i should try? i still have the python shell open and can reproduce the step |
| 18:02 | ubernostrum | Erm. |
| 18:02 | ubernostrum | There are some potential issues there. |
| 18:03 | ubernostrum | Any time you set up a default manager which filters the initial QuerySet, you raise the possibility that things which rely on the default manager (e.g., base_save() will screw up. |
| 18:04 | ubernostrum | So it's quite possible that at the time save() is called, the default manager doesn't find the record in the DB and so thinks it needs to INSERT. |
| 18:04 | tux21b | ok, sounds logically. i will give it a try without the manager and report :) |
| 18:04 | ubernostrum | Also, your manager tries to do a lookup type of 'qt'. |
| 18:05 | ubernostrum | It probably wants to do 'gt' instead. |
| 18:05 | tux21b | qt? |
| 18:05 | tux21b | ah, ok |
| 18:05 | tux21b | first i try without one... |
| 18:09 | tux21b | ubernostrum, ok. the bug is related to our manager. with out one it works... so i am really sorry for that |
| 18:09 | tux21b | but i still don't really understand why |
| 18:09 | tux21b | we have this source, so objects doesn't filter anything: http://paste.pocoo.org/show/79991/ |
| 18:17 | tux21b | ok problem solved. if you are interested, the ordering of the definitions matters. so, objects must be the first manager defined in Article |
| 18:20 | cramm | tux21b: just as documented (last paragraph) :) http://www.djangoproject.com/documentation/mode... |
| 18:22 | tux21b | oh, i feel realy awful about it... sorry. but many thanks anyway :) |
| 20:07 | jhenry | Here's the code to make the related object descriptor cache work: http://dpaste.com/66477/ |
| 20:10 | jhenry | Are there any major changes in implementation that would have to happen in order for that to be a generally-usable piece of code? |
| 23:22 | elliott | is #6755 anywhere near completion? |
| 23:22 | DjangoBot | |
| 23:23 | elliott | i want to start on moving my userprofile to use model inheritance, but only if i know i'll be able to test it on the admin site tonight |
Page 3 of 3
← Previous
(298 total)