#django

/

      • void has quit
      • cronin
        FunkyBob: Really? I discovered them recently and thought Django was gravitating towards them.
      • FunkyBob
        cronin: as you've proven to yourself, sometimes a function is far simpler
      • zeograd joined the channel
      • no
      • the_rat has quit
      • Django is using them for reusable, extensible views... not _all_ views
      • dnukem123 has quit
      • cronin
        FunkyBob: Okay, well that's a relief then. I'll just stick with function views for things like this.
      • honestemu
        FunkyBob: Yeah, I'm still not seeing the changes. Could it be something in my settings?
      • FunkyBob
        honestemu: so you're changing polls/static/polls/style.css ?
      • cronin
        FunkyBob: Any best practices in terms of organization yet? For instance, does it make sense to create a function_views.py and cbv_views.py or do people usually just keep it all in views.py? I guess that's a fairly subjective question…
      • honestemu
        FunkyBob: Yup. All that's in there is a change in the color of the links to green and an image in the bottom right.
      • FunkyBob
        cronin: they're all just views
      • but you can put views wherever you like
      • Cyph0n has quit
      • cronin
        okay, thanks
      • Cyph0n joined the channel
      • johnraz has quit
      • garrypol_ has quit
      • Baylink has quit
      • jtri
        FunkyBob: the select options are a list of file names, and teh files are serialized objects, the serialized objects are collections of data
      • frege joined the channel
      • FunkyBob
        so a filepathfield won't fit
      • iqualfragile_ joined the channel
      • mwmnj joined the channel
      • prtcl has quit
      • jtri
        the files are not uploaded...so i don't think so
      • Cyph0n has quit
      • Spark23 joined the channel
      • Cyph0n joined the channel
      • the app just needs to check a directory, and put the files on a list, i could limit the files in a particular directory to map 1 to 1 to the list, all the files on the list
      • iqualfragile has quit
      • Ariel_Calzada joined the channel
      • Oddo has quit
      • Baylink joined the channel
      • I think i'll add the methods to the same class that managed the files, in cases where the file doesn't exist that class creates it etc.
      • jayfk has quit
      • FunkyBob
        I'm not certain, but I don't think FilePathField needs to refer to files in media
      • koleS has quit
      • jSanp has quit
      • jtri
        FunkyBob: i'll take a look a the filepath, you convinced me it might be worth it, i've used it for uploading files and perhaps it is the right way
      • dblado has quit
      • alperkanat has quit
      • hwrd|work has quit
      • macabre has quit
      • iqualfragile_ has quit
      • freannrak
        I'm trying to reverse my queryset, but it seems I'm stuck on something really silly: http://dpaste.com/1322306/
      • Cheekio
        apollo13, got a second?
      • FunkyBob
        freannrak: put a - on the front of your order_by field name
      • iqualfragile joined the channel
      • mattmcc
        freannrak: You're not updating the queryset instance.
      • johnraz joined the channel
      • queryset = queryset.order_by(...)
      • freannrak
        ahh :D
      • Cyph0n has quit
      • mattmcc: it works! thank you
      • dali has quit
      • honestemu
        FunkyBob: What do you think the issue is? I believe I followed the tutorial to the letter.
      • logix812 has quit
      • amb1s1 has quit
      • iqualfragile_ joined the channel
      • iqualfragile has quit
      • Leeds joined the channel
      • kartarn
        Hi you'll, one question: What is the equivalent to "Rake tasks" in a python/django environment?
      • Pandee
        I am watching a tutorial on Django, but they are using django 1.2. Is it a bad idea to use this as a learning resource since it's a few years old?
      • mattmcc
        kartarn: You might take a look at fabric.
      • kartarn
        yes it is
      • Unifox has quit
      • fabric thanks @mattmcc
      • santiissopasse
        I have a few that returns HttpResponse("You need to be logged in to have a stream") if a user is not logged in, however, when I try to access it when not logged in I get ValueError at /stream/ the view didn't return an HTTPResponse object, any idea what's happening?
      • Pandee
        kartarn, you talking to me?
      • jaddison joined the channel
      • mattmcc
        Pandee: There's a tutorial in the documentation.
      • iiie0 joined the channel
      • ghento joined the channel
      • santiissopasse: Are you sure you don't have a path out of the view that doesn't return a response?
      • kartarn
        yes Pandee
      • santiissopasse
        yeah, there's only two, the one that works and the one that I posted
      • mattmcc
        Not that I don't believe you, but since Django says otherwise, how about pasting your view.
      • Pandee
        kartarn: ok
      • jarshwah joined the channel
      • santiissopasse
      • the code after else: is what's messing up
      • mattmcc
        It's not returning anything.
      • gremmie joined the channel
      • jaddison has left the channel
      • polishnorbi has quit
      • kartarn
        mattmcc: hmm.. Fabric doesn't work for me. What I want to do is to create some scripts to fill my DB with dummy data. But I don't want them in my migration scripts I want them to be on demand
      • mattmcc
        kartarn: Oh, fixtures.
      • kartarn
        yes !
      • amb1s1 joined the channel
      • santiissopasse
        mattmcc: what should it be returning? shouldn't an HTTP Response at least take me to a page with just the mesage?
      • mattmcc
        santiissopasse: If you returned it, sure. But you're missing a word there.
      • jtri
        yeah, when i used the FileField to upload files, I still used a ModelChoiceField to map the files, and since I don't have a model for the files this time, it's a little more complicated handling the choices
      • santiissopasse
        mattmcc: oh haha, I see
      • m8 has quit
      • mattmcc: ok fixed, thanks, I feel dumb
      • amb1s1
        where is the best place to put your script on django app models or views
      • mattmcc
        amb1s1: What kind of script?
      • bwreilly has quit
      • amb1s1
        like datetime
      • dali joined the channel
      • to get the date
      • ElPollo has quit
      • FunkyBob
        amb1s1: not everything must be in models or views.... it's all just Python, after all
      • jtri
        arguably, however, i want to have a model for the file names, so that the ids of selected files always mapped to the same filename...
      • ElPollo joined the channel
      • in fact, i think that's the only sensible thing to do
      • mwmnj has quit
      • I guess the model could have a couple methods that looked in the directory, and added any missing files, etc
      • twikz joined the channel
      • Baylink
        OPS: The link in the django blog to pip appears to point to an alias of readthedocs.org, and Chrome complains about this. To whom would such observations best be directed?
      • Matadoer joined the channel
      • FunkyBob
        Baylink: in what way does chrome complain?
      • skeet70 has quit
      • Baylink
        In a 3/28 blog entry, pip is linked to https://pip.rtfd.org/, but that's apparently an alias and the cert is for the spelled out name, or the reverse. I approved it now, and would have to dump the browser to get the warning again. Anyroad, that's not the domain I end up on.
      • FunkyBob
        ah, I see
      • Baylink
        This may have to do with https-everywhere, or Chrome's equivalent.
      • batisteo has quit
      • FunkyBob
        indeed, I've just replicated the issue
      • I guess that one falls to either Jacob, or the rtfd team
      • jeffisabelle has quit
      • Baylink
        I would say catch it in the server side, myself, or kill the alias.
      • d8 has quit
      • johnraz has quit
      • I think it's going to require recutting the cert with the altname
      • jtri has quit
      • FunkyBob
        Baylink: I'd recommend you take it up with rtfd
      • joshfinnie has quit
      • Baylink
        In other news, my suse python-setuptools package includes easy_install, but not pip; off to find out why.
      • Noted.
      • kartarn
        thanks mattmcc I found what I wanted :)
      • FunkyBob
        Baylink: your what package?
      • yassine has quit
      • Baylink
        suse labels it "python-setuptools", in their repo
      • contains easy_install and all it's backup code.
      • FunkyBob
        install virtualenv, see if that helps
      • Baylink
        But it doesn't appear to contain pip. Ok, lessee here.
      • That doesn't appear to be packaged at all.
      • rmaceissoft joined the channel
      • MicahCarrick has quit
      • Nope, nothing appears to provide pip or virtualenv. <sigh> I love growing grass to get a hamburger.
      • I'll get it; my VPS provider needs to get a little more up to date than 11.3.
      • polishnorbi joined the channel
      • d8 joined the channel
      • FunkyBob
        you got a VPS, and you picked SuSE?
      • Baylink
        I've been a suse guy for 9 years, yes.
      • The only other RPM based distros they presently have are C5 and 6 and F12; to date, I haven't cared.
      • brntn has quit