should this call the delete method on the model? Refmod.objects.filter(id__in=orphans).delete()
EyePulp joined the channel
I overrode it, but it's not being called, I believe...
amcorreia has quit
scrapcode joined the channel
mucco has quit
scrapcode
Is there a way to dump information posted by a form for understanding reasons
mucco joined the channel
jtri
scrapcode: yes, i use pdb in the view to inspect
busla joined the channel
pp (pretty print) is very handy there
dir(form) is handy to see what methods are avail
busla has quit
scrapcode
jtri, thanks! I'll start there.
jtri
scrapcode: that combined with the doc usually helps make some headway
i'm trying to figure out why the delete method on a model (which i am over-riding) is not being called when this is run: Refmod.objects.filter(id__in=orphans).delete()
yoongkang has quit
yoongkang joined the channel
scrapcode
I haven't ran into a specific issue yet, but I'm about to tackle making my "Update Quanitites" functionality on a little shopping cart app I'm making. I'm going to make the whole cart a custom form and the text boxes be named with the "ShoppingCartItem" pk.
so I want to be able to see what data is being passed and how to reduce the headache of figuring it all out
yoongkang has quit
Leeds has quit
plfiorini joined the channel
jhfisc joined the channel
I think I'll implement my idea and it'll be easier to ask for a code review to see if I should've designed it a bit different
jtri
I guess the docs confirm this does not call the delete method...
looks like pre-deldete signal might be the right thing, or perhaps looping over model instances and calling delete
nethop joined the channel
jhfisc has quit
amcm joined the channel
om_henners has quit
tac-tics joined the channel
jhfisc joined the channel
busla joined the channel
tac-tics
I just noticed /admin is not available on my live site, but is available when I use runserver. Is this due to some configuration on my end? Or does django disable the admin site when DEBUG=False or something like that?
_matix joined the channel
busla has quit
om_henners joined the channel
_matix
i'm using a 3rd party module for creating & sending mail; every time I create a new object (Mail.objects.create) i'd like to automatically schedule a background task for sending that mail. is there any way to decorate the Mail.objects.create function *every time* it's imported
my intuition is to just create a helper function somewhere in my main module which does this, but i'm not sure which standard django file to put this in
lolidunno joined the channel
catchybob joined the channel
jhfisc has quit
jhfisc joined the channel
hamub joined the channel
scrapcode
I have a shopping cart that has models User, Product, ShoppingCartItem. The "Cart" page lists the users "ShoppingCartItems" which have the quantity in the cart, etc. on the shopping cart view I have the quantity in a text box and want to update all the items at once when a button is clicked. How would I go about doing this with djangos form class?
It feels like something that would be structured around a ViewModel in ASP.NET... is doing something like that normal in Django?
exaroth joined the channel
jhfisc has quit
jhfisc joined the channel
littlebit1 joined the channel
I assume "formset" is the closest thing to being able to achieve what I want. But I'm not sure how to go about it.
Since I'm not really wanting to create empty forms...
hello) I create ModelForm auto during CreateView, it uses modelform_factory()... I would like to set clean() and clean_field_name() form methods to check some forms data... can I just monkeypatch form, which returns from modelform_factory()?
say i get passed a conn object that is the return value of psycopg2.connect(..) how can i have it print the actual url that im connecting too?
delgiudices joined the channel
theology
what is the difference between models.DateTimeField(default=timezone.now) and models.DateTimeField(auto_now_add=True) , FunkyBob ?
pdehaye has quit
pdehaye joined the channel
kartik7996 joined the channel
emr
theology, maybe auto_now_add=True is safest way for default=timezone.now but i'm not sure, just guessing
littlebit1 has quit
ashish1500616 joined the channel
ammit joined the channel
ashish1500616
Hello EveryOne.
macskay has quit
vlt
ashish1500616: Hi!
ammit
hey :)
ashish1500616
I want to know how to only use the attributes not having null values of an object in my template.
andyhoang2 joined the channel
pdehaye has quit
I am a developing a site of question papers for my university students.So I want to display only attributes having some picture(value) of the object a class.How to do this ? :- I am new to django.,Here is a link to my code:-http://dpaste.de/ZAzi
adamchainz joined the channel
nkuttler
ashish1500616: well. you probably want an image model with fk to subject
ashish1500616: field_counter is almost always wrong
ashish1500616: but.. if obj.attribute
tau joined the channel
and btw, there's ImageField
src="/media/{{question_views.question_image_1 }}" that's also bad
andyhoang2 has quit
there's question_image.file or url or somesuch
image.url actually
question_image.image.url actually, if it were an imagefield
ashish1500616
nkuttler: Yes.,I am having Img files.what should I use in place of src="/media/{{question_views.question_image_1 }}"?