#django

/

      • shangxiao joined the channel
      • croepha has quit
      • ramsub08
        hello shangxiao
      • ciurkut
        ramsub08, probably a dict
      • pilva joined the channel
      • brockhaywood has quit
      • Siphion joined the channel
      • brockhaywood joined the channel
      • grumpi joined the channel
      • EyePulp joined the channel
      • garrypolley joined the channel
      • Wu joined the channel
      • garrypolley has quit
      • rotwatsb joined the channel
      • brockhaywood has quit
      • AndyRez joined the channel
      • jor has quit
      • brockhaywood joined the channel
      • Zeograd joined the channel
      • m8 has quit
      • Zack263 joined the channel
      • postsneakernet has quit
      • techsilo joined the channel
      • greenstatic has quit
      • nodedfree
        hi, how can i assign new foreignkey 'article' to existing 'reporter'??
      • reporter = Reporters.objects.filter(id=2) | article = Articles(title='test',reporter=reporter) | article.save()
      • elyezer joined the channel
      • i get an error when trying to put an object 'reporter=reporter'
      • infinitesum joined the channel
      • infinitesum
        What’s the best way to handle email confirmation? Specifically, the email column in my user table has unique=True, so I want to make sure someone can’t create an account using someone else’s email and then prevent them from creating an account. (Or should I just let the user whose email it actually is do a password_reset to log into the account and then delete the account or whatever.)
      • Knyght
        you're going to have to give us the error
      • infinitesum: send them an email with a link with some random unique string, write a view that handles it and sets is_active on your user
      • pilva has quit
      • maryokhin has quit
      • sjk
        Is it possible to do force case insensitive uniqueness on a charfield? So that if I try to add 'Blah' when 'blah' already is added, an exception is thrown?
      • Knyght
        sjk: write a validator?
      • micahd has left the channel
      • infinitesum
        knyght: Interesting, do you happen to know if Django Rest Framework respects is_active when validating auth tokens?
      • (or rather, when giving them out.)
      • ramsub08
        hello guys, I have a form in a page and I'm handling it in a view(method A). If a special case occurs, the method A will do a HTTPResponseRedirect("URL B"). URL B has method B in view. will I be able to check if the form is valid or not ?
      • Knyght
        infinitesum: not sure offhand
      • infinitesum
        oh it looks like jpadilla just updated it a week ago… nice!
      • sjk
        Knyght: is it possible to have the validator simply lowercase the data and add it transparently?
      • Knyght
        infinitesum: I took a look at the source, looks like it respects is_active
      • infinitesum
        knyght: thanks
      • Knyght
        sjk: no, but you can do that in your save() method
      • Boogymanx joined the channel
      • rajalokan joined the channel
      • Boogymanx
        Evening guys
      • I'm getting an error when running migrations live (this wasn't an issue on local)
      • hydraidm801
        is there a way to split a DateTimeField into day hour minutes in a modelform ?
      • Knyght
        hydraidm801: you probably want a javascript solution
      • I suppose you could probably do it, but you'd have to make a widget and deal with all that stuff
      • hydraidm801
        cause DateTimeField is a pretty useless field in a rendered template
      • who knows how to input the correct format. Sanitization is non existant
      • Knyght
        hydraidm801: this might be of some use: https://github.com/django/django/blob/master/dj...
      • Walkman joined the channel
      • rajalokan has quit
      • but I would recommend just using some javascript
      • hydraidm801
        Knyght: just on ready remove the field and split it then just join the values on submit
      • Knyght
        hydraidm801: I'm sure you can find something ready made. like jquery datepicker but for times
      • you could also use the one from the django admin if you wanted
      • hydraidm801
        how do I do that? the one for the admin is fine
      • avatarez has quit
      • dvtester44
        Is there any difference between .filter(field=None) & .filter(field__isnull=True)?
      • Knyght
      • hydraidm801
        Knyght: oh thats not that bad
      • Knyght: I'll try that. Thanks
      • Knyght
        it's much easier imo just to use some random jquery time picker
      • sindbad has quit
      • hydraidm801
        I'm just worried about validation. I would assume the admin widget would get the format right
      • Oh I didn't see all the stuff about internationalization and urls. Yikes that is pretty awkward. jQuery UI it is.
      • j1fig joined the channel
      • ramsub08
        hello guys, I have a form in a page and I'm handling it in a view(method A). If a special case occurs, the method A will do a HTTPResponseRedirect("URL B"). URL B has method B in view. will I be able to check if the form is valid or not ?
      • Boogymanx
        Hey guys, does anyone know how I can drop one column from a table without resetting data?
      • garrypolley joined the channel
      • j1fig has quit
      • ramsub08
        Boogymanx: reseting the data ? you mean without disturbing the table ?
      • Boogymanx
        ramsub08: Without having to remove all the data on that specific model
      • issackelly has quit
      • ramsub08
        Boogymanx: Idk if I'm interpreting it correctly, but from what you say, drop the column from the database using whatever SQL you've, remove that from your model, run migrate
      • garrypolley has quit
      • michalmo joined the channel
      • knbk
        Boogymanx: remove the field from the model, run makemigrations & migrate
      • no need to manually run any SQL, that would just complicate things
      • nahtnam joined the channel
      • Boogymanx
        Well, the problem I'm having is that even if I remove it, I still have a flawed migration
      • choosegoose joined the channel
      • issackelly joined the channel
      • ramsub08
        knbk: I'm new here, sorry about that !
      • Boogymanx: ^
      • Boogymanx
        No worries :)
      • knbk
        how is it flawed?
      • Boogymanx
        I had a conversion error, but I just removed the latest two migrations of that app and ran makemigrations again
      • that fixed it
      • I just hope that I can now properly use FilerFileField
      • because that's kinda crucial :p
      • Wu joined the channel
      • BabySuperman joined the channel
      • eefvx joined the channel
      • pacodastre joined the channel
      • pacodastre
        _o/
      • rotwatsb has left the channel
      • Azelphur
        Does anyone know what "Could not import 'password_reset_complete'. The path must be fully qualified." means? My app is a 1:1 copy of http://musings.tinbrain.net/blog/2014/sep/21/re... and I'm getting errors after submitting my email on /register/
      • jarshwah_ joined the channel
      • ramsub08
        knbk: I have a form in a page and I'm handling it in a view(method A). If a special case occurs, the method A will do a HTTPResponseRedirect("URL B"). URL B has method B in view. will I be able to check if the form is valid or not ?
      • Azelphur
        In fact it looks like all calls to anything that generates a URL ({% url %} template tag, redirect(), etc) fail with that error. What gives? :(
      • jarshwah has quit
      • josePhoenix joined the channel
      • jessamynsmith
        oh css
      • Dominee joined the channel
      • doismellburning
        css L(
      • *:(
      • jaykay joined the channel
      • Vbaz joined the channel
      • jessamynsmith
        pretty much
      • this has nothing to do with django, but what would you call the things that denote a list, the bullets or numbers?
      • list... specifiers?
      • issackelly
        jessamynsmith Indicators?
      • jessamynsmith
        indicator seems a better word
      • issackelly
        maybe as a designer
      • jessamynsmith
        thank you
      • issackelly
        I'm there there's a typographical word
      • jessamynsmith
        I'm trying to name a css class
      • issackelly
        **ask a designer
      • jessamynsmith
        :)
      • it doesn't have to be perfect, just reasonable
      • mattmcc
        CSS calls them markers, iirc.
      • jessamynsmith
        oh!
      • mattmcc
      • eefvx has quit
      • jessamynsmith
        thanks mattmcc :)
      • this is the most helpful channel :)
      • graffix joined the channel
      • tonythomas has quit
      • ehmatthes joined the channel
      • nahtnam
        Hey guys! I am planning to make a simple way to keep track of my grades. I just have one question. I will be having classes, and then each class will have grades attached to it (10/10, 15/20, etc). I was wondering if I should make two different apps, one for grades, and one for classes, or just stick it all in one app?
      • shadowbeast joined the channel
      • doismellburning
        nahtnam: all in one app
      • z3r0-c00l joined the channel
      • fgau joined the channel
      • nahtnam
        doismellburning: Kk. TY. So would the app just be called classes? (Im a total n00b at django and im having trouble understanding what is classified as an app).
      • doismellburning
        nahtnam: understandable
      • nahtnam: it's blurry, but generally, "broad groupings of functionality"
      • jaykay
        hi! in my tests, reversing an url takes 400ms in one case. subsequent reversings of the same url still take 100ms. to me that sounds horribly slow. is there anything i might have done wrong?
      • chadhs joined the channel
      • issackelly
        nahtnam :: basically it's arbitrary. It's a distinction for you
      • more than it's a distinction for the framework
      • nahtnam
        doismellburning: Kk. Ty