#django

/

      • kaakku
        mpessas_, Yeah, I was just checking that out...
      • melhiors has quit
      • mpessas_, I don't know if it would break other URLs that are made with further paths appended to it. like b/photos/the_one
      • mpessas_
        kaakku: Oops, typo. Correct one would be: r'^b/?$'
      • jtiai
        kaakku: What's your goal?
      • mpessas_
        The dollar at the end will make it match only that one
      • moonkid has quit
      • kaakku
        jtiai, I have a popular page with something/popular/ and..
      • below that I have something/([-\w]+)
      • jtiai, If a user visits something/popular, then I want Django to server him the actual popular page.
      • jtiai, Instead of going down and checking something/([-\w]+)
      • sahilsinha has quit
      • munichlinux has quit
      • jtiai
        kaakku: Then what mpessas_ said should work.
      • kaakku
        jtiai, Yeah, it is working. I am just worried if it would break anything else.
      • Thanks mpessas_ :)
      • mpessas_
        kaakku: You are welcom
      • e
      • jtiai
        kaakku: Not really, though I suppose you set APPEND_SLASH to False...
      • kaakku
        jtiai, The default is True. I have not set it to False.
      • jtiai
        kaakku: Then you shouldn't be able to hit url that doesn't end with slash. if there is no slash django will issue redirect to slashed version.
      • melhiors joined the channel
      • kaakku: That though requires that you do have CommonMiddleware in your middleware list.
      • kaakku
        jtiai, That's the thing right.. when something/popular does not end with a slash, Django scans the entire URL list before the automatic redirect to appending a slash.
      • When Django does that, it finds to match something/([-\w]+)
      • jtiai
        kaakku: Right. Forgot that since I always use slashes at the end.
      • Cavedude has quit
      • kaakku
        jtiai, Hmm... We should have designed our URLs better I guess.
      • Debnet`Work joined the channel
      • jtiai
        kaakku: could be worse...
      • kaakku
        jtiai, Heh.
      • melhiors has quit
      • jtiai
        We originally decided that using json-rpc is a wonderful idea...
      • kaakku
        jtiai, Never used it until now. I presume you had regrets?
      • ThomasC joined the channel
      • trustyhank has quit
      • lacrymology joined the channel
      • lacrymology
        FunkyBob: in the classy-settings docs you say "composition over inheritance" and then propose the use of mixins.. how are mixins composition and not inheritance?
      • FunkyBob
        because a mixin, in theory, provides an isolated interface
      • mbj117 has quit
      • codeitloadit joined the channel
      • kaakku
        mpessas_, That does not work because it breaks other urls that has the form b/what/is/
      • mpessas_
        kaakku: Did you put the $ at the end?
      • donspaulding has quit
      • NoNMaDDeN joined the channel
      • Qowface has left the channel
      • kaakku
        mpessas_, Yes. These are my URLs: "something/b/?$, include('app.urls')" and "something/([-\w]+)"
      • So when I try to visit any of the URLs within that include,
      • the something/([-\w]+) is what gets executed.
      • mpessas_
        kaakku: Can you give an example of the URL you try to visit?
      • kaakku
        mpessas_, Let me dpaste the actual thing for you.
      • lacrymology
        FunkyBob: so non-colliding names, or at worse no super()-calling is considered "composition"?
      • let's forget the super thing
      • Efrin joined the channel
      • toothe
        if my request.POST variable has multiple forms, how do I go through them and assign their values to an object?
      • kaakku
      • mpessas_
        kaakku: So, you also want to match b/anything/? Then you should drop the $
      • rozwell has quit
      • The dollar makes the regular expression only match /popular/ with or without a slash
      • kaakku: Otherwise, it just moves to the next entry
      • stack has quit
      • kaakku: You may have to explicitly set the /popular (without a slash) url though
      • jtiai
        kaakku: Well if you consider that rpc uses single endpoint url for multiple requests, yes it's really shitty thing you can do... We picked that just because I couldn't figure out how to do restful magic...
      • kaakku
        mpessas_, Oh... darn. The ?$ should have been in the first entry within trending/urls.py right?
      • mpessas_
        kaakku: It seems so
      • kaakku
        mpessas_, I think so. Let me see.
      • holler_ has quit
      • MasterPiece joined the channel
      • mpessas_
        kaakku: I am just thinking, this would however break the rest of the URLs
      • stack joined the channel
      • ie, it would try to match populartoggle_highlight instead of popular/toggle_highlight
      • kaakku: So, you may have to set the / at the start of the rest of the URLs
      • kaakku: Or, set the version without the / at the end explicitly in the urls.py and don't bother with it in traending/urls.py
      • kaakku
        mpessas_, Let me try playing around. We should get this right with a few trial and errors.
      • toothe
        I can't find documentation on BannedPhraseForm.
      • Sikh has quit
      • tac_ joined the channel
      • kaakku
        mpessas_, The only change required was to remove that "$" from the end within urls.py :)
      • mpessas_, The $ is there within trending/urls.py.
      • mpessas_, So now it matches popular and popular/ and also goes and see what is there in trending/urls.py before it goes below.
      • mpessas_, So things are looking up now :)
      • mpessas_
        kaakku: great
      • eyeballz joined the channel
      • kaakku thinks all this goes to show how much /me sucks at regex.
      • hydraidm801 has quit
      • swi joined the channel
      • zkanda
        apollo13: What plugin do you use for job matrix in djangoci?
      • shashank_ joined the channel
      • McMAGIC--Copy has quit
      • McMAGIC--Copy joined the channel
      • mmikeym has quit
      • skylite joined the channel
      • munichlinux joined the channel
      • ghostlines has quit
      • marxxin joined the channel
      • crazydiamond joined the channel
      • melhiors joined the channel
      • munichlinux has quit
      • datakid has left the channel
      • Cyph0n_ has quit
      • omarek joined the channel
      • omarek
        Hello everyone
      • atula has quit
      • veebull has quit
      • FunkyBob
        omarek
      • lacrymology has quit
      • JayFK joined the channel
      • mattblack123 joined the channel
      • grumpi joined the channel
      • Cyph0n_ joined the channel
      • siqi_ joined the channel
      • Cyph0n__ joined the channel
      • EstebanVelour joined the channel
      • Cyph0n joined the channel
      • silverfix joined the channel
      • jargon joined the channel
      • LucSaffre joined the channel
      • Cyph0n_ has quit
      • sayan has quit
      • Cyph0n__ has quit
      • Cyph0n_ joined the channel
      • Cyph0n_ has quit
      • Cyph0n__ joined the channel
      • Cyph0n has quit
      • prabampm has quit
      • neataroni has quit
      • Cyph0n_ joined the channel
      • tac_ has quit
      • prabampm joined the channel
      • Cyph0n__ has quit
      • okimoyo has quit
      • eyeballz has quit
      • proteusguy joined the channel
      • aribao joined the channel
      • bearish joined the channel
      • jcdesimp joined the channel
      • Ergo joined the channel
      • gazumps has quit
      • sayan joined the channel
      • Genitrust joined the channel
      • bikeshedder joined the channel
      • benregn joined the channel
      • Cyph0n_ has quit
      • Cyph0n_ joined the channel
      • mbj117 joined the channel
      • yomilk has quit
      • f_davis has quit
      • Cyph0n_ has quit
      • xchu has quit
      • Cyph0n__ joined the channel