2008-11-25

02:29 mdhancher
Today's patch r9527 added a new dependency on the bz2 module. Do folks think this was intentional (in which case this might be a documentation bug) or unintentional?
02:29 DjangoBot
02:30 Alex_Gaynor
mdhancher: it's included with python isn't it?
02:30 mdhancher
Hmm, actually you're right, my build of Python just didn't build it for some reason.
02:31 ubernostrum
mdhancher: some operating systems have a habit of distributing a "python" package that doesn't include the normal Python standard library.
02:31 mdhancher
Yeah, but by the look of it this one was my fault (rebuilding Python without bz2 dev libraries), not "theirs".
03:32 ubernostrum
Gulopine: my advice is just do whatever seems logical.
03:34 Gulopine
yeah, i figured
03:34 Gulopine
i just sent it in tonight, already
05:23 Guest13365
testing
05:23 abadr
help
05:28 abadr
I can't see anyone talking in here, including myself.
05:31 Alex_Gaynor
no one is talking
08:49 mrts
brosner: do you want me to do any further work on #9493?
08:49 DjangoBot
08:50 mrts
you mentioned that once 1.0.1/1.0.2 is out, it may be commited
14:07 deryck
Hi ho
16:08 mrts
jacobkm: Wrap help_text in "<span class="helptext"></span>", (needs ticket) -> #8426
16:08 DjangoBot
16:09 mrts
also, as the implementation was trivial, I'd say it's ready for checkin
16:09 mrts
(apart from a review of course)
16:11 jacobkm
OK
16:37 Alex_Gaynor
jacobkm: You an allan sherman fan?
16:37 jacobkm
Alex_Gaynor: what kind of Jew would I be if I wasn't?
16:37 jacobkm
")
16:38 Alex_Gaynor was raised on allan sherman, and believes it can be blamed for anything wrong with him :)
16:39 jacobkm
ha
16:42 jacobkm
telenieko: do you have a git:// URL for your Django repo, or just the http one? I hate how slow git is over http.
16:59 mrts
jacobkm: how do you feel about #8193 ? Do you want any further work on that?
16:59 DjangoBot
16:59 Alex_Gaynor
jacobkm: is the 1.1 features page supposed to be locked for editing to non-admins?
17:00 jacobkm
Alex_Gaynor: no
17:00 Alex_Gaynor
ok, mind if I fix that then?
17:00 jacobkm
Alex_Gaynor: nope, go for it
17:19 kylefox
Has there been any discussion about #4438 besides what's on the mailing list? It seems that discussion seems to keep trailing off....
17:19 DjangoBot
17:20 kylefox
Essentially this is the most up to date discussion on the subject of dynamic SITE_ID: http://tinyurl.com/6hjy79
17:21 apollo13
kylefox: I guess not, otherwise someone would have posted a link to the discussion on the ml
17:28 kylefox
Hmm, okay.
17:29 sebleier
is there a reason why you can't prepopulate admin form inlines with request.GET? or am I missing something?
17:32 kylefox
Another question, I couldn't find a ticket relating to this: has there been any discussion about making an app's Models "swappable?"
17:32 kylefox
Ex: a way to easily plug my custom User class into contrib.auth
17:33 Alex_Gaynor
that's been sort of discussed, the consensus isn't especially positive
17:33 Alex_Gaynor
there's a ticket about it, and it was on the 1.1 features lists that was discussed, but it didn't mkae the cut
17:34 kylefox
Alex_Gaynor: Do you remember the ticket # or description?
17:34 kylefox
what was the opposition?
17:34 Alex_Gaynor
#3011
17:34 DjangoBot
17:35 Alex_Gaynor
the discussing is somewhere in the mailing list, and on jacob's spreadsheet
17:36 kylefox
Hmm. See I think that ticket has the right idea but is short sighted
17:37 jacobkm
kylefox: in general, the idea of "let this class pose as that class" is going to get rejected every time -- it smacks of all sorts of overingineering, and it might well be impossible to get right.
17:37 kylefox
I expect the discussion about swapping models has focused on the User largely because in the real-world, that's the model that would need to be swapped most often.
17:37 jacobkm
On a historical note, Django used to let you do this. It was the biggest cause of instability in the world, and we dropped it in magic-removal and didn't look back.
17:38 kylefox
jacobkm: Right, I understand that. I suppose the problem is that for our application needs a very different User model, but I don't want to re-write the entire auth app
17:38 kylefox
And I don't want to use get_profile() :/
17:38 jacobkm
Why not?
17:39 kylefox
Well....I'm probably going to get told that Django is not the tool for the job....
17:39 kylefox
We're looking at using django to build some SaaS products (please excuse the buzzword ;)
17:40 kylefox
So for example, having a unique username doesn't work for us.
17:41 Alex_Gaynor
Why not create your own Auth Backend then?
17:41 kylefox
Currently to get around that, our UserProfile has a "username" field and a FK to an Account model
17:41 kylefox
Alex_Gaynor: We've done that also
17:42 kylefox
But that's where things start to get ugly, because we're sort of piggybacking the auth.User model, for no other purpose than using the remainder of the auth app
17:42 jacobkm
kylefox: so let's say your auth backend gets to return a custom user object without a unique constraint on the username. How, then, would any of the built-in auth veiws -- nearly all of which key off of or ask for a yusername -- still work?
17:43 kylefox
so we're munging a unique auth.User.username based on their user profile's username and account number
17:43 kylefox
jacobkm: I don't know.
17:43 jacobkm
kylefox: here's a hint: they can't.
17:44 jacobkm
So, if you get to use a custom user object, you also get to write custom auth views.
17:44 kylefox
It's true.
17:44 jacobkm
So now you've rewritten the user object and rewritten the auth views.
17:45 jacobkm
What's left in the auth app you get to reuse? A couple of one-line decorators and a 20-30 line piece of middleware.
17:45 kylefox
Right. I suppose what I'm proposing would be along the lines of adding a completely new layer of abstraction to apps
17:45 kylefox
Which probably isn't feasible.
17:45 jacobkm
So how exactly is this any different from rewriting the app from scratch again?
17:46 jacobkm
Let me propose an alternate scenario:
17:46 jacobkm
You write those custom auth views which you'd have to write anyway.
17:47 jacobkm
You write that custom User object you have to write anyway.
17:47 jacobkm
You write a custom peice of auth middleware that hangs *your* user object off request.user in the same way that the built-in one does.
17:47 jacobkm
You user class provides a similar-enough API to the built-in user app that existing things that expect auth continue to work.
17:48 jacobkm
And now you get custom auth.
17:48 jacobkm
Mmm, some of the built-in auth decorators might not work; dunno about that.
17:49 jacobkm
And if you're User object is strange enough, you might have to write a custom ModelAdmin subclass and override the auth parts of the admin to make stuff work.
17:49 kylefox
Right.
17:50 jacobkm
This proposal (a) only requires a small bit of code more than this pose-as-a-user business, (b) doesn't require the type of monkeypatching that class posing does, and (c) works right now.
17:50 kylefox
I guess what I'm envisioning would (for example) be a more abstract way of writing the auth views such that they don't explicitly refer to the implementation of the User model included with contrib.auth
17:50 ubernostrum likes the idea that if an application doesn't fit your needs you don't have to use it :)
17:51 kylefox
ubernostrum: I also *really* like that idea. Unfortunately, if you toss out auth you toss out the admin ;)
17:51 ubernostrum
That's no longer true.
17:51 kylefox
which is exactly the point I'm getting at
17:51 jacobkm
kylefox: that's not true; like I said you can write a custom ModelAdmin that overrides the auth stuff.
17:51 ubernostrum
Once again it's a bit of work to integrate your own auth scheme into the admin, but it's certainly doable.
17:51 ubernostrum
Just not documented at all.
17:51 kylefox
That's very true i suppose....
17:51 ubernostrum has a "stupid admin tricks" blog post lurking somewhere.
17:52 ubernostrum
People wouldn't believe the shit you can do with the admin these days.
17:52 jacobkm
kylefox: also, you might want to take a close look at the auth views; they don't even import anything from django.contrib.auth.models... they're probably a lot more flexible than you think.
17:52 kylefox
It is *very* cool alright. I suppose I never really thought about overriding the reliance on contrib.auth.
17:53 jacobkm
But frankly if you're going to use a different user you probably want different ways of changing passwords and stuff.
17:53 kylefox
jacobkm: You're correct in that. I've done some digging and I suspect I could reuse a lot of the behind-the-scenes code in contrib.auth for a custom auth app
17:53 kylefox
Okay, well thanks for the insight.
Page 1 of 3   Next →(231 total)