#django

/

      • HowardwLo
        OH, i guess that wasnt to me :D
      • my mistake
      • joelones
        right, was just wondering what the convention is, I guess something like modelA/pk/modelB/pk
      • karanlyons
        HowardwLo: Then you might as well use the default auth. But if you need registration pages and such, something like django-registration will help a lot.
      • apollo13
        but django-registration is no longer maintained/developer afaik
      • SenseiBulba has left the channel
      • sentinal8473 joined the channel
      • karanlyons
        apollo13: Nah, ubernostrum stepped down in 2013.
      • apollo13
        developed*
      • karanlyons
        joelones: Yeah, ideally you'd not use the PKs but some other unique and human grokable value (also, security concerns about incrementing ID leakage).
      • HowardwLo
        karanlyons: well, I authenticate using Email instead of username. trouble is, the form error says “username” and not “email”. I guess I need to work out my own login() and authenticate() ?
      • karanlyons
        So something like /my-parent/my-child/.
      • HowardwLo: What version of Django are you using?
      • HowardwLo
        karanlyons: 1.5
      • ThatAndromeda joined the channel
      • sonofdirt has quit
      • karanlyons
        So you made USERNAME_FIELD the email address, right?
      • sligodave joined the channel
      • nszceta joined the channel
      • ustunozg_ joined the channel
      • Kayra has quit
      • HowardwLo
        karanlyons: actually, I have a custom user with Email field
      • nszceta
        django 1.6.5 hangs while attempting to render my model admin
      • no idea what to do :(
      • mstrcnvs
        nszceta: do what your heart says
      • nszceta
        burn it all
      • mstrcnvs
        I'm kidding, just paste the code and the traceback
      • nszceta
        no traceback!!!
      • o_O...
      • karanlyons
        HowardwLo: Yeah, and that inherits from AbstractBaseUser?
      • windyhouser has quit
      • ThatAndromeda has quit
      • nszceta: Start wolf fencing out apps until you figure out which one is causing problems, then wolf fence out models in that app.
      • nszceta
        I know what model is causing it
      • I can't figure out why
      • kenbolton joined the channel
      • karanlyons
        nszceta: If you can, post all the code up to dpaste and let us take a look.
      • Synthead: How's it going?
      • Synthead
        karanlyons: librabbitmq doesn't support python 3?
      • karanlyons
        Ah, shit.
      • Nah, it doesn't, I don't think.
      • nszceta
        Will do sir. Be back in a few
      • nszceta has quit
      • karanlyons
        I'm still on 2.7 because of other dependencies, so I wouldn't have noticed.
      • Synthead
        karanlyons: does that mean that my celery tasks and django would have to be python 2?
      • karanlyons: or can I run celery as python 2 with django on python 3?
      • ls3 joined the channel
      • karanlyons
        That's a good question.
      • You *could* definitely do it, but there are some possible complications involved.
      • ls3 is now known as lyles
      • lyles has quit
      • lyles joined the channel
      • HowardwLo
        karanlyons: one sec, i’m digging through the code to see what the hell is going on
      • mmikeym has quit
      • Synthead
        karanlyons: I imagine that celery has to be on python 2 to see librabbitmq on python 2, and since celery integrates tightly with django, django and everything else would need to be python 2 also
      • newzen joined the channel
      • karanlyons
        Synthead: I'm investigating to see if there isn't something we know to work that we can swap in for librabbitmq in Python 3.
      • tiktuk has quit
      • Synthead
        karanlyons: I'm using python-amqp at the moment, but it seems like everyone's in favor of librabbitmq
      • karanlyons
        Synthead: librabbitmq is faster for being C, but py-amqp is developed by ask (who develops celery) as well.
      • Try uninstalling librabbitmq, and any other Python rabbitmq packages, and just running py-amqp.
      • tiktuk joined the channel
      • librabbitmq is, I think, the most performant Python client, but sadly has no Py3 support yet.
      • ilovett has quit
      • Ariel_Calzada has quit
      • Kronuz joined the channel
      • kenbolton has quit
      • tbaxter has quit
      • dman777_alter has quit
      • tbaxter joined the channel
      • ilovett joined the channel
      • Kronuz
        in multitable inheritance, an index_together declared in the parent model get's propagated to the childs (when the child doesn't itself declares a Meta) ...and a validation error arises stating the fields are not available in the child model
      • is this something someone else can replicate? am I doing something wrong?
      • tbaxter has quit
      • HowardwLo
        im a little confused at my own frankenstein code. I seem to have email in forms but not in models….. but its saving the email properly
      • karanlyons
        Kronuz: Can you show us the code? Cause it'd be helpful to see the inheritance flow.
      • wldcordeiro has quit
      • sligodave has quit
      • HowardwLo: You shouldn't need forms at all if you're extending djang.contrib.auth's User model. Unless you're making custom registration pages or something.
      • joelones
        karanlyons: what would you use instead of pks?
      • HowardwLo
        karanlyons: i might’ve. I cant remember what I did, but I had a problem with django-facebook and hacked the crap out of it to get it to work
      • and im sure it wasnt the right way :/
      • void has quit
      • alexsnake has quit
      • karanlyons
        joelones: Ideally something else that's unique. If you don't have anything like that, then you *can* use PKs, they're just not as nice for human beings to use.
      • stickperson
        hallo. i’m creating a custom manager for one of my models. i have an __init__ method for the manager and am getting the following error: AttributeError: ‘MyManager’ object has no attribute '_inherited'
      • bluedreams joined the channel
      • Kronuz
        karanlyons: I'll set up a test here with the vanilla django
      • (I have some patches applied on django)
      • HowardwLo
        shit for all i know, i probably added the field using South -.-
      • karanlyons
        joelones: Then there's an issue with auto incrementing IDs exposed to the public, which is that anyone can trivially loop through all your IDs, which is a bad attack surface to have.
      • joelones: So if you're going to expose PKs, you want them to be non continuous to some extent. Something like simpleflake is great because it's non continuous but also includes a seconds since epoch, so your new rows will be continuous in the database.
      • tiktuk has quit
      • HowardwLo: Haha, oh man, I know that feeling of returning to a forgotten hack. Good luck!
      • w00tner
        what does suppress the backwards relations ? for related_name in ManyToManyField
      • karanlyons
        w00tner: I'm afraid I don't understand the question. Could you rephrease it?
      • Kronuz
        karanlyons: I think it's something else in my code (the source of the problem)
      • karanlyons
        Kronuz: Got it, we're here if you need us.
      • sligodave joined the channel
      • HowardwLo
        karanlyons: is it difficult to move emails and hashed/salted passwords from one column to another? I think I stored the users under the wrong column :(
      • w00tner
        QUOTE: ManyToManyField.related_name Same as ForeignKey.related_name. f you have more than one ManyToManyField pointing to the same model and want to suppress the backwards relations, set each related_name to a unique value ending with '+'
      • tiktuk joined the channel
      • karanlyons
        HowardwLo: Not difficult, but not trivial.
      • w00tner
        when i would like to supress backwards relations. what does that mean and when i will be using it?
      • karanlyons
        You'd want to create the new column with blank=True, loop through the rows and copy the data from the old column, remove the old column, and then remove the blank=True decleration.
      • I *think*, hard to say exactly without seeing your schema/code.
      • Kronuz
        karanlyons: thank you! :)
      • karanlyons: found it!
      • must be a bug in django
      • bluedreams has quit
      • rajesh joined the channel
      • sligodave has quit
      • lyles has quit
      • m8 has quit
      • karanlyons
        w00tner: related_names have to be unique, because otherwise they'd clash.
      • Kronuz
      • must be a bug when using abstract base classes and multitable inheritance
      • MrBaboon joined the channel
      • it only happens if Place has an abstract base class which declares index_together
      • (might also happen with other stuff in Meta)
      • karanlyons
        w00tner: If you end the related_name with "+", Django will see that plus and won't create the backwards relation, which means that the destination of your relationship won't have a way to trace back to the source.
      • Kronuz
        ... I've tested so far with v1.6.6dev
      • HowardwLo
        karanlyons: my problem is, I was using django-facebook for the facebook login, but I seemed to have the regular email registration save into the user column for facebook....
      • aeikenbe_ has quit
      • w00tner
        thanks karanlyons
      • mribeirodantas has quit
      • HowardwLo
        karanlyons: so now I have to flush out the email registration, and tie it in with django-facebook
      • karanlyons
        Kronuz: Oh, I bet Django isn't properly hooking up the _meta to the class.
      • w00tner: No problem.
      • Debnet
        Hello everyone.
      • karanlyons
        HowardwLo: so User.username has what should be User.email_address?
      • Debnet
        I'm trying to convince my company using Django can be a very good deal for their front-office.
      • Kronuz
        probably since it sees it's an abstract, it let's it pass to the children (but it shouldn't since the children inherits from a concrete)
      • Debnet
        But, as a company, they need warranties and for myself I need to know some "real" limitations of Django in a business project.
      • HowardwLo
        karanlyons: for facebook, I’m not exactly sure what they use Username for, but under personal information: First name, Last name, Email, thats where I shoved the email
      • Debnet
        Do you have any clues?
      • HowardwLo
        so I’m authenticated via a profile? or something
      • nedbat has quit
      • karanlyons
        Kronuz: Actually, I think the issue is your Place model isn't abstract. But I'm spitballing, I'm not testing anything.
      • nedbat joined the channel
      • HowardwLo
        karanlyons: gah, wish i knew more
      • mstrcnvs has quit
      • karanlyons
        Debnet: What are you trying to build? Is the question "is Django stable" (yes) or "is Django right for our project?" (maybe)?
      • Debnet
        I understand, precisions.
      • Kronuz
        karanlyons: yes, it's not abstract, thus, the meta inherited by the children using multi-table inheritance shouldn't get those values in the parent (Place) model's Meta
      • mattblack123 joined the channel
      • ...but django somehow gets confused (as the Meta is declared in the abstract parent)
      • karanlyons
        HowardwLo: I'm just having trouble groking what your setup is like. So you're using FacebookModel with a OnetoOne to the User?
      • Kronuz
        if I move the index_together to the concrete model, then it works