10:09 AM
shashank_ joined the channel
10:10 AM
moldy
vsdanilov: with CharField, it finds something
10:10 AM
SpoutBE
@vsdanilov: works on Firefox 44 and Chrome 48
10:11 AM
noregret
10:11 AM
moldy
10:11 AM
SpoutBE: hmm, i wouldn't expect this to be browswer-dependent. did you use the same search term? with 1.9 selected?
10:12 AM
SpoutBE
"65 results for charfield in version 1.9"
10:12 AM
SomeRandom has quit
10:12 AM
moldy
SpoutBE: that's weird. can you provide a link?
10:13 AM
SpoutBE
Same link as vsdanilov provided
10:13 AM
moldy
10:13 AM
[coda] joined the channel
10:13 AM
ahh, cache.
10:14 AM
vsdanilov
With CharField "65 results for charfield in version 1.9"
10:14 AM
moldy
vsdanilov: refresh your browser cache :)
10:14 AM
shangxiao joined the channel
10:14 AM
vsdanilov
it works now
10:16 AM
half_brick joined the channel
10:16 AM
half_brick has quit
10:17 AM
molavy
FunkyBob: django.contrib.auth.views.login don't handle user password wrong error message
10:18 AM
it just show login form again
10:18 AM
zetab joined the channel
10:18 AM
darkoran has quit
10:18 AM
and not showing related message, for example username and password combination don't match
10:18 AM
amcorreia joined the channel
10:20 AM
moldy
molavy: the auth docs have an example template that shows the errors from the form
10:20 AM
molavy
10:20 AM
moldy
10:21 AM
``form.this_is_the_login_form``? that looks weird
10:21 AM
Nanor joined the channel
10:22 AM
Nanor
Why will render not reload the page during an AJAX request?
10:22 AM
Should I use something other than render?
10:22 AM
moldy
Nanor: that's a weird question
10:23 AM
kyheo joined the channel
10:23 AM
Nanor
moldy, haha yeah, I thought it was
10:23 AM
I know AJAX is asynchronous so you don't use it for page reloads
10:23 AM
moldy
Nanor: 1) it's not the job of render to reload anything. it just renders a template. 2) isn't the whole point of ajax requests to *not* reload the page?
10:23 AM
shiriru joined the channel
10:23 AM
Nanor
Just the way I've built it, it'd be super easy to reload the page instead of having to write a new method
10:23 AM
moldy
Nanor: a page reload doesn't happen in django. a page reload just means that the browser sends a new request.
10:24 AM
mangolisk
Nanor: you will need to write javascript to update your page using the data returned from your ajax call when it finished
10:24 AM
*finishes
10:24 AM
Nanor
I was afraid you'd say that
10:25 AM
ikke joined the channel
10:26 AM
greg_f joined the channel
10:26 AM
Oooh! It returns the whole template as an object!
10:26 AM
mangolisk
Nanor: You can us render_to_string to render a template and put it in your json return to make it easier to update small portions, but if you want to update something large I wouldn't suggest it
10:27 AM
then your javascript to update is easy with jquery $('#my_outermost_element').html( json_data['render_data'] );
10:28 AM
Nanor
Ahh, that's helpful! Thanks guys
10:28 AM
mangolisk
np
10:29 AM
molavy has quit
10:29 AM
zanderle has quit
10:31 AM
jessamynsmith joined the channel
10:31 AM
noregret
the migration is failing because of a constraint, it's not very clear -
https://dpaste.de/Le8Y - any help is appreciated
10:34 AM
temhaa joined the channel
10:34 AM
temhaa
hello
10:34 AM
I have modeladmin
10:35 AM
And my model has chocies field. How can I search by choices field.
10:35 AM
Can I write search field for choices field
10:35 AM
10:36 AM
[coda] has quit
10:36 AM
jessamynsmith has quit
10:36 AM
Nanor
FWIW I just deleted the body and then loaded the whole returned HTML into the body
10:36 AM
FreedomFighter has quit
10:36 AM
I've a feeling it's hacky as hell but...
10:36 AM
Pheimors
using only the PK ?
10:37 AM
oups, wrong chan :)
10:38 AM
encod3_ joined the channel
10:38 AM
yoongkang
noregret: is it a legacy database?
10:39 AM
akarambir joined the channel
10:40 AM
[coda] joined the channel
10:40 AM
[coda] has quit
10:40 AM
[coda] joined the channel
10:41 AM
LiamM joined the channel
10:41 AM
encod3 has quit
10:41 AM
Croves joined the channel
10:42 AM
vsdanilov has quit
10:43 AM
mimusz joined the channel
10:44 AM
encod3 joined the channel
10:44 AM
noregret
yoongkang: what do you mean by legacy? an old version?
10:44 AM
mimusz is now known as _M_M_
10:44 AM
FunkyBob
noregret: existing before you started using django
10:44 AM
yoongkang
noregret: was it a table created from something other than django
10:45 AM
w0rp
Does anyone know if there's a way to print a query for a QuerySet in a format you can actually run by straight-up copy and pasting it?
10:45 AM
I always have to add in quotes around strings after the fact.
10:45 AM
Because it will output `'foo'` as `foo` instead.
10:45 AM
noregret
yoongkang: no, all tables were created using migrate
10:45 AM
bcc has quit
10:46 AM
FunkyBob
w0rp: since your DB adapter has to handle the interpolation... no
10:46 AM
w0rp
I'm wondering if there's a method you can call which puts the Query through the adapter you're using, and gives you the SQL.
10:46 AM
Because it must at some point generate the SQL string.
10:47 AM
FunkyBob
w0rp: not really.. it would be adapter specific
10:47 AM
w0rp
I'm okay if it only works for Postgres.
10:47 AM
FunkyBob
adn the db adapter is outside the control of Django
10:47 AM
Haudegen joined the channel
10:47 AM
ah, well :)
10:47 AM
_M_M_ has quit
10:48 AM
psycopg2 actually uses libpq to escape values
10:48 AM
encod3_ has quit
10:49 AM
Lisa1157 joined the channel
10:49 AM
w0rp
I basically use it for grabbing a few things and running EXPLAIN ANALYZE against the queries.
10:49 AM
FunkyBob
yah
10:49 AM
I tend to just do it manually
10:50 AM
_M_M_ joined the channel
10:50 AM
noregret
yoongkang: any idea?
10:50 AM
moldy
doesn't django-debug-toolbar do just that?
10:51 AM
_M_M_
Hello all. I want to propose a little path to Django (translation). What is the best way to do that? Via pull request?
10:51 AM
noregret
can I revert the last migration?
10:51 AM
FunkyBob
noregret: just ask migrate to target the prior migration
10:51 AM
_M_M_: pull request and ticket
10:51 AM
noregret
FunkyBob: the thing is, i migrated something and got an error, another migrate is causing an error about duplicates...
10:52 AM
FunkyBob
noregret: can't really help without details
10:52 AM
_M_M_
FunkyBob: OK, so sould I open the ticket at first, and than propose the solution by pull request?
10:52 AM
FunkyBob
_M_M_: yep
10:52 AM
maryokhin has quit
10:52 AM
if it's simple enough, the PR and an email to the ML may be enough
10:52 AM
noregret
10:53 AM
_M_M_
FunkyBob: OK :) and should I request any permission for pushing to the repo?
10:53 AM
FunkyBob
noregret: ah.. mysql... no wonder...
10:53 AM
omarek
Does Django look for static files OUTSIDE app folders by default ?
10:53 AM
FunkyBob
_M_M_: you can't push to the repo
10:53 AM
noregret
FunkyBob: why does everyone here hate mysql
10:53 AM
FunkyBob
omarek: no.. only if you add STATICFILES_DIRS
10:53 AM
noregret: because it's shit?
10:53 AM
yoongkang
lol
10:53 AM
wyoung
noregret: no not just here
10:53 AM
noregret
FunkyBob: i can't say, i'm not db expert
10:54 AM
wyoung
noregret: MySQL is bad if you want to do anything serious
10:54 AM
FunkyBob
noregret: well, it jut bit you... because it doesn't have transactions on schema changes
10:54 AM
wyoung
noregret: it is great for pet / hobby projects
10:54 AM
doismellburning
wyoung: I mean, I disagree
10:54 AM
wyoung
noregret: then again, so is sqlite
10:54 AM
doismellburning
wyoung: there's people doing "serious things" with MySQL
10:54 AM
FunkyBob
10:54 AM
noregret
i see
10:54 AM
doismellburning
I wouldn't *recommend* it, I think it's a terrible idea, BUT they still seem to manage
10:54 AM
wyoung
noregret, doismellburning: I would rather use sqlite than mysql
10:54 AM
noregret, doismellburning: sqlite is more capable
10:55 AM
FunkyBob
10:55 AM
doismellburning
sqlite is pretty much a totally different thing
10:55 AM
that happens to have a similar-looking interface
10:55 AM
wyoung
doismellburning: no there isn't as oracle wont allow that :)
10:56 AM
doismellburning: no, sqlite in daemon mode is the same
10:56 AM
noregret
lol
10:56 AM
i have no idea that the community was against mysql that much
10:57 AM
kyheo has quit
10:57 AM
wyoung
noregret: it isn't in #php or #joomla, but most of those people are idiots
10:57 AM
noregret
haha
10:57 AM
wyoung
because they choose to use php or joomla
10:57 AM
FunkyBob