#django

/

      • raijin joined the channel
      • eraldo
        the admin UserCreationForm is hardcoding the "User" model.. I overwrote that to match the new 1.5 custom user style get_user_model() .. how can I now contribute the changes back to django?
      • velcrow joined the channel
      • zerick has quit
      • xcbt has quit
      • mrap has quit
      • jamescarr joined the channel
      • chrisjones has quit
      • mrap joined the channel
      • mezner joined the channel
      • jdunck joined the channel
      • InvidFlower joined the channel
      • velcrow
        What's the optimal way to associate a user profile with a user that I created in a shell/registration form.
      • Thank
      • s
      • introspectr3
        User.objects.filter(is_staff=0, is_active=1,) # How do I filter for groups as well? I only want users in "TEST" group returned?
      • jdunck has quit
      • Daishiman joined the channel
      • chuckharmston joined the channel
      • uuball_gabriel has quit
      • dirn has quit
      • InvidFlower
        Trying to go through the docs but is there an easy way to have an admin list page just have a different url for each link than the standard admin page for each obj?
      • skiernose joined the channel
      • Daishiman
        Hi everyone. I'm trying to register admins for proxy models of a custom User model, but it appears as though the admin is using the base User Admin instead, or at leaset it's not using important methods like get_queryset() or the proxy model's default manager. Any idea why this happens?
      • InvidFlower: try to create a function in the ModelAdmin that prints the desired link, and add the function name to the list_display
      • InvidFlower
        Daishiman Thanks will try that
      • empty joined the channel
      • canibanoglu has quit
      • mezner has left the channel
      • eraldo
        is there a template tag just like "capfirst" but capitalizing every first letter? I guess workaround would be to split it as a list of words and use the capfirst on each
      • sudobangbang has quit
      • mattmcc
        InvidFlower: See allow_tags and short_description in the docs for list_display.
      • eraldo: Strings have a 'title' method.
      • enkrypt has quit
      • eraldo
        mattmcc: perfect..
      • that was what I was looking for ..thank you :)
      • jayfk has quit
      • xcbt joined the channel
      • MentalPower has quit
      • pkill joined the channel
      • justhamade has quit
      • cyberspace- has quit
      • vbabiy|away is now known as vbabiy
      • empty has quit
      • enkrypt joined the channel
      • hwrd|work has quit
      • EyePulp has quit
      • hyperair has quit
      • tm8522010 has quit
      • ambar has quit
      • heedly joined the channel
      • raijin has quit
      • dirn joined the channel
      • markalanevans_ joined the channel
      • InvidFlower
        Daishiman and mattmcc: Thanks for both of those suggestions. Got it
      • dblado joined the channel
      • markalanevans has quit
      • markalanevans_ is now known as markalanevans
      • mrap has quit
      • eraldo
        is there any python pattern for existance-conditional spaced variable string construction (http://dpaste.com/1203091/)
      • I use that a lot .. there gotta be smarter ways :)
      • raijin joined the channel
      • plabo joined the channel
      • FunkyBob
        eraldo: can't you just use ' '.join([....]) ?
      • mattmcc
        Yeah.. ' '.join([getattr(self, x) for x in ('title', 'race', 'char') if getattr(self, x)])
      • FunkyBob
        or ' '.join(filter(None, (getattr(self, x, None) for x in ....
      • tm8522010 joined the channel
      • mattmcc
        Yeah.
      • eraldo
        seems efficient but not very readable
      • that's why I like the format string.. makes the code easy to read
      • xcbt has quit
      • FunkyBob
        build a list... join it
      • mrap joined the channel
      • velcrow
        What's the optimal way to associate a user profile with a user that I created in a shell/registration form? ty
      • l3on has quit
      • FunkyBob
        velcrow: with a OneToOne field?
      • mrap has quit
      • velcrow
        Really, that's it?
      • FunkyBob
        erm
      • you were expecting something else?
      • velcrow
        So when I process the user registration form
      • FunkyBob
        User is just a model like any other
      • mezner joined the channel
      • velcrow
        I just add in a User Profile model or something
      • FunkyBob
        auth is an app like any other... it's not like it has special powers
      • velcrow
        Ok
      • FunkyBob
        well, in Django 1.5 you might consider using a custom User model
      • jamescarr has quit
      • mihasya has quit
      • dagorim_ joined the channel
      • empty joined the channel
      • l3on joined the channel
      • eraldo
      • dali has quit
      • caleb_ joined the channel
      • pydonny has quit
      • bwreilly joined the channel
      • pydonny joined the channel
      • schinckel
        That's because race is a model: you'll need to try str(getattr(self,x)) for x ...
      • eraldo
        schinckel: I see.. thanks
      • velcrow
        FunkyBob, What's that?
      • FunkyBob, Never mind, found it.
      • I like the one-to-one solution to start
      • foxiness has quit
      • sjzabel joined the channel
      • Makes most sense to me
      • pydonny has quit
      • jamescarr joined the channel
      • sjzabel has quit
      • chrislkeller has quit
      • sjzabel joined the channel
      • dali joined the channel
      • bwillielv joined the channel
      • bytephilia joined the channel
      • Ariel_Calzada joined the channel
      • non_117 is now known as non_away
      • cyberspace- joined the channel
      • sgambino joined the channel
      • hyperair joined the channel
      • non_away is now known as non_117
      • k_sze[work] joined the channel
      • jarshwah has quit
      • mihow has quit
      • QliXed joined the channel
      • jarshwah joined the channel
      • QliXed
        Guys... i get stuck with something... i don't know if it is a bug or a feature :D
      • I got this on urls.py: url(r'^(?P<network>'+ipsegment_regex+')/ip/add/$', IPAddressAdd.as_view(), name='ip-add'),
      • Where IPAddressAdd is a CreateView...
      • and i don't get the network on the requestcontext
      • is this normal?
      • mattmcc
        Yeah, urlpattern arguments don't go to the context automatically.
      • QliXed
        On others goes automatically
      • but not in that..
      • maybe the CreateView don't spec a urlpaterrn arg on the call?
      • rrjamie has quit
      • jfw
        no, that never happens
      • scottyob
        I'm wondering if I can pick everyone's brains on something. I've got a great process workflow system created to try and remove paper and it works great and everything, but, now people want to be able to physically print the forms *sigh*. Any ideas on the best way to make a Django Form/ModelForm print friendly?
      • QliXed
        Guys on DetailView the pk pattern get in automagically...
      • jfw
        scottyob: reportlab
      • KingdomSprite has quit
      • mezner has quit
      • scottyob
        jfw: I didn't know about report lab, that's pretty neat. I wrote the framework in such a way that with each user process, it took a ModelForm though. Including a processes 'preview' is rendering a ModelForm. I was hoping for a way to load up a ModelForm but replace all the TextBoxes and the like with static text, but keep the Div layouts they might have put in
      • elena joined the channel
      • chuckharmston has quit
      • QliXed
        freaking django classes...
      • jfw
        QliXed: i don't know offhand if the pk gets set in the context of a DetailView, but if it did, it would be because the class needs it. your random argument in a url isn't going to get automatically put into the context
      • setmeaway joined the channel
      • scottyob: it'd be easier to just write simple templates that loop over the same fields that you've put in your form and output them.
      • dagorim_ has quit