#django

/

      • tbaxter
        The first item should represent the object that you are clicking to
      • choki
        so i can not set the second item bold? i want to keep this order :"(
      • tbaxter
        I mean, you could override the template, but you'd be solving the wrong problem.
      • choki
        yeah seems not a good idea
      • too much work
      • ok
      • i just change the order then
      • :/
      • tbaxter
        choki: Understand WHY the first item is bold. Then it makes sense.
      • choki
        because there need to be some item clickable
      • tbaxter
        That's part of it, yes
      • choki
        but django shouldnt assume things, django is not rails. no magic pls
      • any jrief here?
      • tbaxter
        choki: It's not magic, it's just a basic assumption that the first item in the list is the most important. Because it should be.
      • jessamynsmith has quit
      • The first item in the list should represent the object you are linking to, in some clear way.
      • choki
        tbaxter: you're right, it should always be the first item bold. my fault.
      • consistency across lists
      • tbaxter
        keNzi: By my estimation, you should have one, maybe two, abstract models.
      • choki
        now i understand
      • tbaxter
        keNzi: You've seen my abstract content models and how they're used, right?
      • keNzi
        yup
      • choki
        sorry to get you crazy
      • you tried to help me i was like a dick xD
      • eroussel joined the channel
      • raijin has quit
      • frozenjim joined the channel
      • hutch34 has quit
      • de-vri-es joined the channel
      • keimlink has quit
      • tbaxter
        choki: Not crazy on this end. Did I sound angry?
      • keNzi: category can be a very simple model, IMO.
      • choki
        i like your rage mode :D
      • jessamynsmith joined the channel
      • keNzi
        tbaxter: I actually need few more fields for Category model ;)
      • falk0n has quit
      • bouke has quit
      • tbaxter
        choki: No seriously, did I sound rage-y there? I sure hope not.
      • keNzi: such as?
      • not saying you don't, but just curious
      • moldy
        choki: i'm as close to jrief as it usually gets in this channel ;) what's the issue?
      • acangiani joined the channel
      • choki
        moldy: you know him from RL?
      • moldy
        choki: yes, and we work together on stuff
      • choki
        oh
      • kaiserbald0 has quit
      • nickabbey joined the channel
      • Azendale has quit
      • Left_Turn has quit
      • avnee joined the channel
      • moldy
        so if you tell me what the issue is, i may be able to help -- i assume you are using one of the packages he maintains?
      • choki
        i just wanted to ask him, i'm kinda like his padawan :D
      • moldy
        well, i am not sure i can help with *that* :p
      • choki
        moldy: did you use django-leaflet yet?
      • moldy
        choki: no
      • choki
        :"(
      • moldy
        i am sure he will be amused if i forward him this conversation ;)
      • choki
        no pls dont
      • moldy
        choki: still: what's the issue?
      • choki: hehe ok
      • choki
        i need to ask him in RL
      • harmaahylje
        moldy: do you have experience with django-lockdown? Am I supposed to replace my login view with their AuthForm?
      • Left_Turn joined the channel
      • moldy
        choki: well, if you want some consulting that goes beyond support for open source stuff, you will probably have to pay him. or you can tell us your question and somebody here might be able to help.
      • harmaahylje: 1) not really. 2) i don't think so, judging by the form's docstring
      • choki
        moldy: do you live near him in the same city?
      • bluesomewhere joined the channel
      • harmaahylje
        moldy: in that case it seems like lockdown is not what I was looking for. It seems to be just for locking down the site from users. I want a feature that makes sure only logged in users are able to use the site
      • moldy
        choki: no. he lives in austria, i live in germany.
      • MasterPhi joined the channel
      • choki
        moldy: you the maintainer of django-shop?
      • pretodor joined the channel
      • moldy
        choki: co-maintainer
      • meaning jacob does all the work, but i have push access ;)
      • choki
        git push -f :D :D
      • Haudegen has quit
      • moldy
        harmaahylje: i was under the impression that django-lockdown provides this feature, but i may have been wrong
      • tbaxter
        austria, germany.. same difference :-)
      • We don't do much geographying here in the States.
      • moldy
        choki: if you have a question about django-shop, you can ask me. maybe in #django-shop. i am most likely second most knowledgable person about it on this planet, so...
      • choki
        moldy: how can i create a django admin form to set a point on a map?
      • geminizer has quit
      • moldy
        choki: heh, i have no idea, but that sounds like a question related to geodjano, or maybe you are looking for a google maps app or such?
      • choki
        moldy: with geodjango i have to use a spatial database? the last time i visited geodjango it kinda looked like dead :/
      • harmaahylje
        moldy: to me it seems that it doesn't provide that feature. It almost does what I want, but there is a form added that an user can use to "preview" the site by providing his credentials. After that it shows my login form. I think I will go the middleware route for this
      • moldy
        choki: so what do you want to do? what problem do you need to solve?
      • harmaahylje: did you try to just ignore that form?
      • choki
        moldy: i want to enter geo data in the backend, i want to have a map there to choose a point (lat/longtitude)
      • moldy
        choki: you want to integrate the map into the admin?
      • harmaahylje
        moldy: no, but I am supposed to use the form implementation to provide the feature I want
      • choki
        yes
      • XofP joined the channel
      • moldy
        choki: i'd probably not do that. instead, write your own view + form to handle this usecase.
      • tbaxter
        choki: are you asking the user to provide a geocode, or are they providing an address which you will later map?
      • choki
        moldy: my own view in the admin?
      • moldy
        choki: your own view outside of the admin
      • choki: and i think it's likely somebody has written some google maps thingy before
      • choki
        tbaxter: no they need to set the point on a map like with the mouse on google maps, drag and drop
      • i feel kinda bad to do so, why creating my own view if there is django admin
      • tbaxter
        Then I gotta agree with Moldy. You need a custom view. And I don't know what all else.
      • choki
        i tried django leaflet but no widget ever renders there
      • i feel sick
      • tbaxter
        If it was a case where I give an address and you'll show that address on a map, that you can do in the admin.
      • choki
        i know i can do this project with wordpress in a few days
      • moldy
        harmaahylje: the lockdown docs suggest that the form thing is optional, but maybe i am reading them wrong :)
      • tbaxter
        choki: I think the main thing is the map integration. If you can write the JS to get the map position and AJAX that to a view. which then stores the info, then you're home free.
      • Ergo joined the channel
      • choki
        :/
      • jrief would never tell me :D
      • grumpi has quit
      • he would say: "hey, just use this django package xy, doing the job for you!
      • mmalone joined the channel
      • tbaxter
        Well, if you can find a package that does what you need, then you're set. I don't know of one, but there's a good chance one does exist.
      • vingiesel joined the channel
      • choki
        i tried django-leaflet, no success :"(
      • docs suck
      • this is exactly what i want https://github.com/makinacorpus/django-leaflet#... but I dont see any map rendered
      • tbaxter
        I've never used it, but it looks straightforward enough
      • well, is the JS loading?
      • moldy
        choki: have a look at your browser's javascript console
      • choki
        tbaxter: the description below "in adminsite" makes no sense to me. how would this code render that widget?
      • i ll try...
      • avnee has quit
      • vingiesel has quit
      • avnee joined the channel
      • tbaxter
        Well, admittedly, that example would make a lot more sense if you knew what the "weatherstation" model looked like
      • mmalone has quit
      • choki
        why do you help me?
      • why do people like you help me on irc, you get nothing from me, you may waste your time, i could be a dick
      • tbaxter
        I ask myself that very question almost every day
      • :-)
      • adamsilver joined the channel
      • moldy
        hehe
      • choki: we also help each other
      • kayamm joined the channel
      • tbaxter
        Nah, I help because I like to help. And because people helped me. And because often I learn something too
      • choki
        how could i help you then? im newb baby kitten
      • tbaxter
        Dunno. But there may come a day.
      • moldy
        choki: stay around, do projects, write code, and soon enough you will not be a newbie anymore
      • tbaxter
        Or maybe you just help someone else on down the road. We all pay it forward.
      • adamsilver
        I have Organization model with owners = models.ManyToManyField('auth.User')... isn't this wrong and I should have the field on the UserProfile model?
      • tbaxter
        FWIW, I'm coming to agree with you.. their docs are pretty weak.
      • adamsilver: set the relation to settings.AUTH_USER_MODEL and you're always covered.
      • syphar has quit
      • moldy
        adamsilver: hmm. assuming there is a one-to-one between user and profile, i don't think it makes much difference
      • avnee has quit
      • syphar joined the channel
      • adamsilver
        tbaxter & moldy: my question is about whether I should have the ManyToManyField field on Organization or User/Profile
      • The logic is a user can belong to multiple orgs