#django

/

      • gremly joined the channel
      • badcat
        i wish :D
      • could live off 150k eur for a while
      • dimadima
        desktop apps... who cares
      • badcat
        like 2 weeks or so ^^
      • etenil
        seen Firefox OS?
      • badcat
        noe
      • dimadima
        though i'm glad learning iOS dev gives me OS X dev pretty much
      • badcat
        nope*
      • dimadima
        firefox sucks :>
      • and by :> i mean :<
      • etenil
        looks like soon there won't be much difference between "web" and "desktop" (or pockettop)
      • hypolin joined the channel
      • dimadima
        the only rationale i can understand for using firefox is that it's foss. otherwise, i just don't get it.
      • etenil
        I said "Firefox OS", not "Firefox"
      • no troll dimadima
      • ianawilson joined the channel
      • dimadima
        etenil: oh no, i know. i just assumed firefox os : firefox ~ chrome os : chrome
      • Jakey joined the channel
      • etenil
        nope not the same
      • dimadima
        aka apps written in JS running in a JS interpreter
      • etenil: oh, intereresting
      • rogi has quit
      • etenil
        well somewhat, except that firefox OS doesn't fire up a web browser for you
      • gazumps has quit
      • it's at a lower level than chrome os
      • hkj has quit
      • Y3K
        IMHO what's happening is that both desktop and web apps are getting closer and closer... For obvious reasons they can't be at the same "level", but the browsers are growing better so it's possible to dispatch more "rich" content to the user via web :)
      • Ramialhamad
        hey guys, quick question, I'm using modelformset_factory and when I load the resulting instance, I get two forms, one with a prepopulated form with the data that I just saved in my first try and one that's empty.
      • hyperair joined the channel
      • dimadima
        what gives with the django-related question?
      • etenil
        well it's an answer to the difficulty of programming for multiple closed and complex platforms
      • the common denominator
      • cjurk has quit
      • Y3K
        Ramialhamad: And the question is...
      • etenil
        many apps for ios are just a webkit frame with a bit of website inside
      • Ramialhamad
        I have this simple add button that's supposed to add a row in my db. When I press the submit button, I want a form to load that's blank so that users can enter data
      • instead
      • dimadima
        i'm guessing he wants one gorm
      • form*
      • Ramialhamad
        I get two forms
      • from the factory object
      • one that's repopulated with data that I just entered in my first try
      • whizmob has quit
      • Y3K
        Ramialhamad: Check the extra argument
      • Ramialhamad
        I noticed extra int = 1 in the debugger
      • thanks Y3K! I will look into it
      • etenil
        ok thanks for the help dudes, bye!
      • etenil has quit
      • Y3K
        etenil: You're welcome. See ya
      • josh3336 has quit
      • Leeds joined the channel
      • gazumps joined the channel
      • FSCV joined the channel
      • jpadilla has quit
      • FSCV has quit
      • moreisee has quit
      • Ramialhamad
        @Y3K, I read the docs but I can see how to add two blank forms (extras) but how do I get it to only show the blank form?
      • Y3K
        Why the Model's doesn't have a clean_<field> method like the forms? if I want to overryde the clean of only one field I need to use clean_fields and exclude the rest :S
      • pucko
        What is the proper way of overriding save() in a model for Django 1.4?
      • Y3K
        Ramialhamad: Oh! Sorry, I missunderstood you. Well, in that case just don't pass any instance to the formsetfactory.
      • FunkyBob
        pucko: why do you want to override it?
      • Y3K
        pucko: Just override it :P
      • That's a better question...
      • FunkyBob
        asking that always puts me in mind of http://bash.org/?866112
      • pucko: ?
      • Y3K
        FunkyBob: Hahahaha, that's hilarious
      • FunkyBob
        pucko: your reason will influence the best solution
      • Ramialhamad
        Y3K, I don't think I get what you mean by not passing an instance
      • The code is only few lines long
      • the one I have there doesn't have 'User' in the form set factory
      • prabampm joined the channel
      • that just breaks it
      • Y3K
        Ramialhamad: I think... I think you're using wrong the formsetfactory...
      • Ramialhamad
        Y3K, haha, seriously?
      • Y3K
      • KrauserIII has quit
      • You must pass the Model's class to the formsetfactory
      • kanja joined the channel
      • Ramialhamad: Something you aren't doing in your gist :)
      • Ramialhamad
        Yeah, I mentioned that earlier. I am passing it to it, I just took it out to see if that's what you meant by not passing in an instance.
      • Which in hindsight makes no sense.
      • I have UserFormSet = modelformset_factory(User)
      • in my code now
      • Y3K
        Ramialhamad: Hmmm TBH I think I'm a bit lost... Can you please dpaste the whole view and a screenshot? Hahaha
      • prabampm has quit
      • isomorph_ joined the channel
      • Ramialhamad
        Haha, sure thing! Thanks for the help.
      • jordanmessina has quit
      • endra
        Does translation.activate() respect LANGUAGES in settings.py?
      • isomorph has quit
      • Ramialhamad
        Y3K, the gist link now has the HTML for the page as well the view code
      • Y3K
        If I override the model's clean() method shoud I use super().clean in it or just write my code?
      • gazumps has quit
      • mattmakai has quit
      • kanja has quit
      • Ramialhamad: Are you really trying to add MULTIPLE users at one time or just create an user?
      • Ramialhamad
        just create user!
      • that's the annoying bit
      • borgos joined the channel
      • when I click on add user, I end up with two forms when I just want one
      • reading up on form sets on django right now
      • Y3K
        Ramialhamad: You're really lost then...
      • Hmm... Read the docs from the startup :P
      • Ramialhamad
        Haha, I'm not contesting how lost I'm. Just started on the django journey, I lived on the mobile world for a while.
      • Y3K
        formsets are designed to handle multiple instances in one time...
      • Ramialhamad
        crap
      • hahaha
      • Y3K
      • And if you want to just "jump" to the Auth part, read this: https://docs.djangoproject.com/en/1.5/topics/auth/
      • jaccc joined the channel
      • jaccc
        hello
      • Y3K
        jaccc: Hello.
      • Ramialhamad
        hi jacc
      • Thanks Y3K!
      • brunocedraz joined the channel
      • Y3K
        Ramialhamad: You're welcome :)
      • jaccc
        now that function-based generic views have been deprecated, what should i use in urls.py instead of direct_to_template and redirect_to?
      • starsinmypockets joined the channel
      • Y3K
        jaccc: django.shortcuts.render|redirect
      • starsinmypockets
        I'm seeking employment and want to post a recent django ecommerce project on github... aside from obfuscating db and api keys any thoughts regarding security?
      • Y3K
        (For a second I thought you were saying that all the FBV are deprecated :P)
      • santiissopasse has quit
      • starsinmypockets: Well, the SSL of course is a must.
      • jaccc
        thanks!
      • Y3K
      • Raisins has quit
      • mattmakai joined the channel
      • jcarbaugh joined the channel
      • home has quit
      • Ergo^ has quit
      • Ramialhamad
        Y3K, thanks for the tip, I found what I actually need. FormModel and not form set..i should've paid more attention to the docs. Thanks for the help.
      • ambar has quit
      • sunya7a joined the channel
      • Y3K
        Ramialhamad: You're welcome. And yes, try to follow the docs always, they're indreible good written and complete (most of the cases) :)
      • badcat has quit
      • prabampm joined the channel
      • FunkyBob
        Y3K: incredibly
      • Y3K
        FunkyBob: Oh... Noted. Thank you :)
      • randomdrake joined the channel
      • Wait... What the heck did I wrote? "indreible"? Hahaha.
      • jaccc
        now it's telling me The included urlconf %s doesn't have any patterns in it :/
      • FunkyBob
        heh
      • Y3K
        jaccc: My fault, I told you about the shortcut functions, not the Gerenic ones, take a look here: https://docs.djangoproject.com/en/1.5/ref/class...
      • jaccc: There are the CBV equivalents :)
      • FunkyBob
        those are the two shortcuts you'd want to replace the views mentioned
      • cro has quit
      • Y3K
        FunkyBob: But he's using them directly in the URLS... Shouldn't use a CBV for that?