2008-7-5

00:52 paltman
was there ever a models.OrderingField?
00:52 paltman
django_sqlalchemy is attempting to make use of that field and it doesn't appear to be valid
00:53 Gulopine
hahahah
00:54 Gulopine
yeah, there was
00:54 paltman
has been droipped or replaced with something else? i was going to patch django_sqlalchemy
00:55 Gulopine
i think it was dropped
00:56 Gulopine
if i recall, it was leftover from the way things used to work, and was no longer used in core
00:56 Gulopine
and i guess nobody spoke up about it before it got removed
00:56 Gulopine
01:01 paltman
thanks
01:02 Alex_Gaynor
I think it was originally added for magic-removal
01:04 Gulopine
so sayeth the link :)
01:04 empty
paltman: yeah I had to implement it because django did.
01:05 empty
but it made no sense at the time.
01:05 empty
so good ridance
01:05 empty
paltman: I will update the dj-sa code or if you want to make the change in your clone go ahead and I can pull it.
01:05 paltman
i am trying to get your gitalicious project running, but am having trouble with dj-al
01:05 paltman
is it in a runnable state
01:06 empty
paltman: not going to work :)
01:06 paltman
or is it still under dev?
01:06 paltman
ahh
01:06 paltman
ok
01:06 paltman
wasn't sure
01:06 empty
the gitalicious code was developed under dj-sa before class replacement.
01:06 empty
now dj-sa support class replacement so I have to update gitalicious.
01:06 empty
is that your main objective?
01:06 paltman
yeah
01:06 paltman
i mean
01:07 empty
paltman: let me priv msg you
01:07 paltman
my main objective is getting gitialicious running internally
01:07 empty
since this is not django related
01:07 paltman
sure
01:18 Gulopine
hey axiak, another minor style question for you if you have a minute
01:47 axiak
dutr
01:47 axiak
sure*
01:48 Gulopine
oh! hey
01:48 Gulopine
is there a particular reason you went with "raw_field" as the name of the input to _save_FIELD_file()?
01:48 Gulopine
seems like an odd choice
01:48 axiak
yeah it might be a little odd
01:49 Gulopine
i have to move all that anyway, and i was thinking about just calling it "content"
01:49 Gulopine
but i wanted your input, in case there was a reason for that name
01:50 axiak
well it's just that sometimes it's not only the content, and the actual object
01:50 Gulopine
well yeah, but i'd argue that the object is content too
01:50 Alex_Gaynor
auto_now and auto_now_add are going to be removed eventually, right?
01:51 Gulopine
that's why i'm chaning it away from "raw_content"
01:51 Gulopine
alex, i believe so
01:51 axiak
ok
01:51 Alex_Gaynor
So they should probably be tossing up a DeprecationWarning
01:51 Gulopine
axiak, i just don't know what it's raw_field, since it's not a field at all
01:51 axiak
yup
01:51 Gulopine
alex, i would think so, but i don't know why it hasn't been this whole time
01:51 Alex_Gaynor
Ok, I'll post a ticket
01:52 Gulopine
good call
01:52 Gulopine
cause yeah, in my mind, those should issue DeprecationWarning and get pulled straight out for 1.0
01:55 Alex_Gaynor
If I just stick raise DeprecationWarning("auto_now and auto_now_add are deprecated"), they will still work, just raise the erorr, or do I need to import warning and do warning.warn() ?
01:56 Gulopine
they still work? that seems odd to me, but i've never tried raising DeprecationWarning
01:57 Gulopine
or are you asking if they'd still work?
01:57 Gulopine
cause i would think it would cause them to break
01:57 Alex_Gaynor
Askiing
01:58 Gulopine
ah
01:58 Gulopine
i think you have to import warnings
01:58 Alex_Gaynor
Ok
02:05 Gulopine
ah crap, i gotta update the tests to use SimpleUploadedFile or something too
02:06 Gulopine
hrm, never got around to seeing if i can combine the apis for that and File
02:17 axiak
you can't raise DeprecationWarning
02:17 Gulopine
ah, okay then, that settles it :)
02:17 Alex_Gaynor
do warning.warn, ok, thanks
02:18 axiak
example:
02:18 axiak
warnings.warn( message = "To access the file size, please use the .size attribute.", category = DeprecationWarning, stacklevel = 2)
02:18 Gulopine hasn't used stacklevel, so i don't really know what that does
02:19 axiak
it changes the line number and function reporting
02:19 axiak
so depending on where it is, it allows the warning to display information about the user's code
02:19 Gulopine
really
02:20 Gulopine
like, showing the line number of where they actually called the wrong thing?
02:20 Gulopine
rather than just where the warning was thrown?
02:20 axiak
yeah
02:20 Gulopine
nice
02:20 empty
yup, like a stack rollback.
02:35 Gulopine
holy carpoh boy
02:35 Gulopine
whoops :)
02:36 Gulopine
two separate thoughts there, meant to delete the first one
02:36 axiak
uh oh
02:36 Gulopine
so axiak, there are now *two* UploadedFiles?
02:36 axiak
:)
02:36 axiak
that's actually fixed in a patch
02:36 axiak
02:36 Gulopine
ah, okay
02:36 axiak
it cleans up a lot
02:36 Gulopine
i guess i need to start looking at that one
02:37 axiak
I think jacobkm will apply that soon
02:37 axiak
he said it was high priority for him
02:37 Gulopine
i just tried debugging tests, and i get "'UploadedFile' object has no attribute 'content'" and i realized i didn't know which one it is :)
02:38 axiak
yeah
02:40 axiak
if you want I can rename raw_field in that patch as well :)
02:42 Gulopine
it'd certainly make me feel less bad about doing it in mine :)
02:42 Gulopine
but with all that, i think it's better for me to just wait until that hits trunk
02:42 Gulopine
on trying to merge this stuff i mean
02:43 Gulopine
cause it'll be just as hard to merge in that patch again once it lands, and i'd rather do he work just once
02:44 axiak
yeah
02:44 Gulopine
k, back to the book
02:56 lakin
axiak: Firefox, the dev server and firefox on apache with mod_python
02:56 lakin updates ticket
02:56 lakin
Firefox 3
03:02 axiak
lakin: hey
03:02 lakin
yo
03:03 axiak
odd
03:03 axiak
that's my default test setup exactly :)
03:03 axiak
so right now I'm in /admin/myapp/file/add/
03:03 axiak
(where file is your File model)
03:04 lakin
Yeah. Strange, I started from a completely clean app, and I can't reproduce it now either.
03:04 axiak
heh, that's bad
03:04 lakin
yeah
03:04 lakin
hrmm
03:04 axiak
you never used any other browser?
03:04 axiak
did you say you uploaded no file, or an empty file?
03:05 lakin
no file
03:05 lakin
The file was already there
03:05 axiak
oh, okay
03:05 axiak
let me try that
03:05 lakin
I just hit save and continue editing again
03:05 lakin
It's a very large file
03:05 lakin
well, not huge
03:06 lakin
I can reproduce it exactly with my current setup
03:07 axiak
interesting
03:07 axiak
this code is invalid
03:07 axiak
__unicode__() returns self.filename()
03:07 lakin
yeah, sorry
03:07 lakin
I was trying to give you a minimal test case and I forgot that line
03:07 lakin
self.filename just returns a string
03:07 axiak
okay
03:07 lakin
here's a clue
03:07 axiak
just try not to make too many changes
03:07 lakin
I had a middleware in my setup that re-creates it.
03:08 axiak
okay
03:08 lakin
it was when my middleware tried to access the request.POST
03:08 axiak
interesting
03:08 lakin
give me a few minutes, see if I can reproduce it with a more minimal example
03:08 axiak
okay, cool
03:15 lakin
hrmm
03:15 lakin
just adding the middleware in didn't get it
03:17 axiak
hmm
03:18 lakin
aaah, it's based on the POST data
03:19 axiak
okay, how so?
03:20 lakin
I don't know exactly, but copying the data I had in my database to the clean install reproduced it.
03:20 lakin
I'm cleaning up a bit and then I'll give you a tarball
03:20 axiak
ok
03:23 lakin
03:23 axiak
ok
03:24 lakin
oops
03:24 axiak
what's wrong?
03:25 lakin
I think the settings file may not be picking up the right database
03:25 axiak
hmm
03:25 lakin
yeah, that was it
03:25 lakin
just set the DATABASE_NAME appropriately
03:26 lakin
There are two files in the db, I've tried saving both and get the error.
03:26 axiak
do you need to send me another tar, or can I make the change to the settings.py file?
03:26 axiak
ok
03:26 lakin
make the change
03:26 lakin
my bad for being so flakey, I'm a bit tired. :)
03:27 axiak
it's okay
03:28 axiak
swim.website.models? :)
03:28 axiak
hmm
03:28 axiak
PathField?
03:29 lakin
argh
03:29 lakin
change it to CharField
03:29 axiak
AutoFileField too?
03:29 lakin
or I can remove all of that if you'd prefer
03:29 lakin
FileField
03:29 axiak
okay
03:29 axiak
just checking
03:30 lakin
yeah, no worries
03:30 lakin
btw, that data isn't public, so I'm going to take that tarball down now
03:31 lakin
So if we can somehow make a better test case before putting on the bug report, I'd appreciate it.
03:33 axiak
yeah
03:33 axiak
btw, you have a username pass :)
03:33 axiak
i'll just set one
03:33 axiak
heh
03:33 axiak
sa/something :)
03:33 lakin
yup
03:34 lakin
I wasn't expecting to have to send a database with the bug report. :/
03:34 axiak
good thing there's a set_password() :)
03:34 lakin
yup
03:34 lakin
and manage.py shell
03:34 axiak
ding ding ding
03:34 axiak
we got something
03:34 axiak
okay
03:34 lakin
so you repro'd it?
03:35 axiak
yep
03:35 lakin
ok.
03:35 axiak
this is great
03:35 axiak
now I have the raw request
03:35 axiak
everything is good now :)
03:35 lakin
cool
03:40 axiak
hahaha
03:40 axiak
I found it :)
03:48 axiak
lakin: so I found the issue
03:48 lakin
ok, cool.
03:48 axiak
I just posted an explanation
03:49 lakin
ok, that makes sense.
03:49 axiak
yup
03:49 lakin thinks
03:49 axiak
yeah
03:49 axiak
so what do you think of 100k? :)
03:50 lakin tries to imagine what firefox would do if you loaded a page with a 100k elements
03:50 lakin
actually, I can do that quite easily. :)
03:50 axiak
well you don't need to
03:50 axiak
you can just create a request
03:50 axiak
especially if it's a django api or something
03:51 lakin
Yeah, I can create one in the admin in my app pretty easily
03:51 lakin
the 'number of codes to create' creates that many related codes
03:51 axiak
well it's more than just the admin
03:51 lakin
yeah, I was just curious what FF would do
03:51 axiak
oh
03:52 lakin
So, back to the real issue.
03:52 axiak
so yeah
03:52 axiak
a piece of me wants to remove the check
03:52 axiak
since it's survived a lot of development
03:52 lakin
raising it would definitely solve the immediate problem and wouldn't likely be hit by most people.
03:52 axiak
and afaik we haven't hit that infinite loop
03:52 lakin
What does django set for it's recursion depth?
03:53 axiak
it's not recursion though
03:53 lakin
yeah
03:53 axiak
but what are you talking about? python has its own checks right?
03:53 lakin
for recursion? yes.
03:53 axiak
does django have its own limit I"m not aware of?
03:54 lakin
Not that I know of
03:54 axiak
ok :)
03:54 axiak
just confused
03:54 lakin
So the only reason it was put in originally was to deal with some infinite loops that were showing up?
03:54 axiak
once a long long time ago
03:54 lakin
Ideally, we'd like to raise an appropriate error if ever another infinite loop shows up
03:54 axiak
and we decided that we never wanted to see that error
03:55 axiak
yeah
03:55 axiak
so maybe something even, like 64k? ;0
03:55 lakin
It's gets incremented for each form field?
03:55 axiak
yeah
03:55 axiak
I'll look to see if there's any better place to count
03:56 axiak
hmm
03:56 axiak
though I don't think there is
03:56 axiak
sigh
03:56 lakin looks at the code
03:56 lakin
Well, the main issue is to avoid a DoS if someone submits an extremely large POSt
03:56 lakin
right?
03:56 axiak
you mean the reason for all of this?
03:56 lakin
yeah/
03:57 axiak
yeah
03:57 axiak
stream the data, rather than loading it all into memory
03:57 lakin
right. But it's also a matter of how much data will we accept in one request?
03:58 axiak
no, that's better dealt with at the apache/lighttpd level
03:58 axiak
like, it gives you the ability to if you so chose
03:58 axiak
but I didn't put that in as a setting or anything
03:59 lakin
Yeah, I was thinking of a setting.
03:59 axiak
yeah...I think that's false security
03:59 axiak
it's a poor way of dealing with it
03:59 lakin
having a setting for it is?
04:00 axiak
doing it in the django side
04:00 lakin
I'm not sure I agree tho. Of course, it's probably more secure and stable to deal with request-size issues at the apache/lightty level, but it's definitely a convenience to do it at the django level too.
04:01 axiak
yeah but it's not like the solution is optimal
04:01 axiak
like
04:01 axiak
the result is poor
04:01 empty
lakin: at the django point you have to already load the file into memory
04:01 axiak
either django soaks up cpu time reading in the network
04:01 axiak
or you cause a connection reset error
04:01 lakin
connection reset error?
04:01 axiak
yeah
04:01 lakin
Why not return an invalid request header or something?
04:02 axiak
:)
04:02 axiak
wouldn't that be nice.
04:02 axiak
the problem is, there's no way to tell apache/lighttpd/etc during the request: "Hey, tell the client to stop giving data and return this data"
04:03 axiak
so you have to options:
04:03 lakin
Oh ...
04:03 axiak
1) Read everything and do nothing with it and return the error
04:03 axiak
2) Force a connection reset error
04:05 lakin
In that case, taking the check out doesn't bother me.
04:05 axiak
or secret option number 3: let apache/lighttpd deal with it :)
04:05 lakin
I keep forgetting that django doesn't come with an built-in production ready webserver. Been doing too much work in CherryPy lately. ;)
04:05 axiak
:P
04:08 lakin
btw, there is a small bug in there, if you unget bytes, _modifications_since is incremented, shouldn't it also be decremented?
04:09 lakin
maybe not
04:11 axiak
absolutely not
04:11 axiak
one of the inifinte loop bugs was ungetting and getting repetatively :)
04:11 axiak
repeatatively*
04:13 lakin
aaah, that's why you started counting _modifications_since
04:19 lakin
Well, thanks for tracking it down
04:19 axiak
thanks for being such a good bug reporter :)
04:19 axiak
the patch is on trac, if malcolm is feeling risky he'll apply it otherwise jacob will get to it
04:19 lakin
heh
04:21 axiak
alright, I need to sleep
04:21 axiak
good night!
19:28 zerok
hi :-) i've got a few logic-questions regarding the new upload handler esp. the memory handler if i may. shouldn't it somehow not just rely on the content-length header? something like throwing an exception within receive_data_chunk the moment the indicated content-length is passed?
22:20 [530]
noone llooks at #6587 , /me bored want work ;)
22:20 DjangoBot
23:28 Gulopine
grah! anybody got experience with the oracle backend?
23:29 Gulopine
not necessarily with using it, but how the query stuff is set up for it