I have ModelForm which displays a few fields for the model. It seems that passing in the data to the constructor for the fields that the form does not display does not get that data into cleaned_data, nor into the instance when you save()
so although I'm passing a value for the field 'chan' into the constructor of the form, when I do form.save() I get a constraint violation because chan is null
When creating South migrations, can you specify a default based on another column in each row?
nkuttler
Oli: sure, you have full access to the ORM. but i think you'll have to edit the migration by hand (and maybe use a datamigration)
void has quit
actually, if you only access the object itself you might be able to do it in the normal interface
Oli
nkuttler: that would be a lot simpler (obviously) but any idea what the object instance is called?
twikz has quit
nkuttler
Oli: should be documented iirc
keimlink has quit
Oli
nkuttler: Have this second landed in the longer south tutorial and it seems to have a nice block on complicated migrations
Thanks for your help
sambao21 has quit
jaddison
Is there a good solution for integrating a Django project with Google Analytics Experiments? (a/b testing) I know there is django-lean and django-experiments, but they don't integrate with GA from what I can tell. Tell me someone has solved this problem already.
aberrant has quit
Leeds joined the channel
jdunck has quit
XofP has quit
foundatron has quit
leetrout has quit
rmarko has quit
pjreddie has quit
nedbat joined the channel
zeograd has quit
gerard0 joined the channel
kenbolton_ joined the channel
ryanisnan has quit
m0rpho has quit
rideh joined the channel
bensmith joined the channel
bensmith
I have a question about django.core.cache. I have cached a value with a 15 second timeout, but as far as I can tell, it never expires. I tried using cache.delete() and cache.clear() to get rid of it, but when I run cache.get('MY_KEY') it's still there.
Scottyob joined the channel
kenbolton has quit
kenbolton_ is now known as kenbolton
I'm using the memcached backend, but when I use the database backend it works fine.
FunkyBob
dunno... we use a redis backend, and it works fine, too
nkuttler has quit
Nervosa joined the channel
aberrant joined the channel
Nervosa
Has anyone used django-registration here? I was using the simple backend for a while for early testing, while I got an email setup. Currently have a domain under gmail now. Anyway, wanting to use the default backend... put in the gmail smtp info (smtp.gmail.com, port 465) login, pass. etc. Anyway. With or without the email details, when I click submit it just goes into infinite loading. No error messages, no debug messages.
hello. I have a big issue, and i guess something really deep in django and/or css is involved. It goes beyong my knowledge on both.
FunkyBob
so, it's not a HTML issue?
orzel
The original bug is "admin pages for my model display full blank", both in firefox/chromium. Playing with firebug shows no element, but the source looks ok
after lot of time, i think the problem is that my model is call "Ad". As such, admin uses a class 'main-ad' for rendering the body. And this seems to be very very bad.
trevortwining joined the channel
for some reson, all browsers render a blank page for such a class. Does anybody know more about this ?
in firefox, this comes down to some weird embedded elemhide.css (line 5064)
the whole body is greyed in the dom tree in firebug
(i never saw that)
mattmcc
orzel: Are you using grappelli or some other custom admin?
twikz joined the channel
orzel
mattmcc: no, bare django
mattmcc
Because Django doesn't have a file by that name.
mgrouchy joined the channel
orzel
as said, it seems to me that this css is 'embedded'. Firefox doesn't report it as an external file
FunkyBob
so... no 3rd party apps in your code?
orzel
uho, even worse, this comes from an extension it seems : file:///home/orzel/.mozilla/firefox/default.hj0/adblockplus/elemhide.css
mm.. and i guess i have adblockplus on both browser.
FunkyBob
ah, well... there you go
mattmcc
Adblock thinks the admin is an ad? :)
FunkyBob
hahaha.. stupid fucking thing us hijacking "main-ad" ? :P
orzel
yops :/
foundatron joined the channel
FunkyBob
mattmcc: hey, where do you stand on the "overrid Model.save()" versus "pre/post-save handlers"?
phonkee joined the channel
mattmcc
FunkyBob: Kinda depends on what behavior you're adding/changing, I think.
And if it's a third party model, odds are you'll not want to replace it, so signals.
orzel
actually i'm not even sure about my name. i use 'Ad' but it's not related to what adblock is supposed to block. Those are real estate ads... :/
bluepnume has quit
FunkyBob
mattmcc: my main concern for heading to handlers was finding this in the source:
save.alters_data = True
redfive-c2g has quit
in the Model class...
kenbolton has quit
twikz has quit
racycle joined the channel
solidus-river has quit
ejd has quit
rideh has quit
napperjabber joined the channel
davidfischer has quit
zandauxzan has left the channel
jmason has quit
fkm has quit
mike_papa joined the channel
fkm joined the channel
bensmith has left the channel
mike_papa
hello. I'm trying to do TDD tutorial for Django from http://harry.pythonanywhere.com/tutorial/2/, and I've got to the point of choice_1 = self.browser.find_element_by_name('choice_set-0-choice'). This doesn't throw any exception, but seems to look forever for element on page. What can be a reason?
rmarko joined the channel
napperjabber has quit
matthewlmcclure has quit
lietu has quit
jderosa has quit
abyss42 has quit
seagreen joined the channel
hypolin joined the channel
aberrant has quit
hyperair joined the channel
pierreN joined the channel
pierreN
hi
trevortwining has quit
jderosa joined the channel
etcetera has quit
FunkyBob
hi, pierreN
mike_papa: I think you'd have to ask the TDD people...
trevortwining joined the channel
mike_papa: or read the docs on whatever class that is
mike_papa
FunkyBob: it's from selenium, for functional tests. Selenium channel seems to be... dead. So I tried here as it sounds (selenium) as something that may be popular in django development.
zauberpony has quit
phildini has quit
napperjabber joined the channel
FunkyBob: isn't functional testing commonly used in real development with Django?
FunkyBob
what's your point?
you're asking for help in here... about a separate product/tool
twikz joined the channel
lots of different testing approaches are used in Django projects
pierreN
this is a dumb question, but: i'm wondering, if i want to put 2 e-mail fields in a subscription wepage through a form, do i have to overload the is_valid method to check the two fields are equal ? is there any exemple out there ? same with password ? thank you.
etcetera joined the channel
FunkyBob
"There are no stupid questions, but there are a lot of inquisitive idiots." :P
leetrout joined the channel
pierreN
ok :)
mike_papa
FunkyBob: I'm just asking as noob if this technique is used, or I'm wasting my time on learning some marginal thing.
FunkyBob
pierreN: well, I'd do it in the clean() method of the form, yes.