free blog   apache   shopping directory   php powered
kezabellea lot of which should be cachable
steve_jwe have a head of cacheing in place, yeah
steve_jit's just hard to know if the session updating will a) just form an orderly queue and get on wiht it or b) cause a fight
mksoftterrasque: No way I could have guessed that :-)
steve_jhence why a super-facst sessionstore would be handy.
steve_ji've seen http://github.com/ericflo/django-tokyo-sessions which looks interesting but has a ticket open on it
jtiaisteve_j: what's wrong with memcache?
steve_jjtiai non-persistent, that's all
steve_jotherwise fine
steve_jwe're already using cached_db sessions
jtiaisteve_j: as a writetrough?
steve_jyeah
steve_jtho i noticed that we're saving the session on every request, for some reason
steve_jhmmn
steve_jis the session timestamp updated on every request anyway?
jtiaisteve_j: Nope. Expiration is only changed when contents of session is changed.
steve_jeg: login, or specific parking of something in the session
jtiaisteve_j: Why there exists this saving on every request to keep timestamps running.
steve_ji'm nto sure
steve_ji thikn it was originally put in place to force the creation of a session if the client is logging in with no existing session (ie cookieless client)
steve_jwe may not need it any more
steve_jjtiai does setting request.user save the session? surely not
jtiaisteve_j: Um... I don't think so.
steve_j]can't see why it woult
diofeherhey, can i overwrite flatpage already registered, doing a extends at FlatPageAdmin and doing another registration like admin.site.register(FlatPage, FlatPageModifiedAdmin)
kezabelleya
kezabelledo admin.site.unregister(FlatPage) IIRC
steve_jdiofeher yeah, that;s right
zimnyxDocs says that Field.to_python() is used to convert database values to field values, why it is not run when I do: print MyModel.objects.get(pk=x).field_name ? I checked it with dbg.
zimnyxAm I getting docs wrong?
zimnyxIt's written here http://docs.djangoproject.com/en/dev/howto/custom-model-fields/ "Converting database values to Python objects¶"
diofehersteve_j: but didn't worked here... i was trying to add tinymce, and i did http://dpaste.com/140894/
kezabelleyes but you haven't unregistered flatpage
steve_jyeah, you need to unregister it first
diofeherahhhh
steve_jthen re register
diofeherkezabelle: like admin.site.unregister?
kezabelleyes
kezabellesee my previous line
munichlinux'InMemoryUploadedFile' object is unsubscriptable I this error I am trying to upload a file
Gratz474still not so sure to do about static content
Gratz474like all i need really isa user sign up and a few other things most of the pages will be static
munichlinuxself.cleaned_data['photo'].read() this is what I am doing
diofeherhaha, it worked... i didn't know about this method
diofeherthanks kezabelle and steve_j
thejumunichlinux: that seems to be fine, a paste would be clearer
munichlinuxhttp://dpaste.com/140905/
munichlinuxtheju, ^
thejumunichlinux: looks ok...which line are you getting the error from?
munichlinuxwhen i do the read
kezabelle1) shouldn't you be doing chunks() instead of read()? 2) have you checked teh data in cleaned_data is actually right?
thejumunichlinux: can you also paste the traceback?
zimnyxI want my database value to be modified before setting it as model field value - how can I achieve this?
munichlinuxkezabelle, yes because once the form is valid it comes to the next step
munichlinuxkezabelle, I tried replacing read with chunks I still get the same error
kezabellewhich is? theju already asked for the traceback
kezabellealso, shouldn't clean return all the cleaned data, not just the one field (I know thats not the issue in this case as you only have one field, but you're doing a field specific clean there)
munichlinuxtraceback: http://dpaste.com/140925/
munichlinuxkezabelle, so what do you suggest?
munichlinuxtheju, ^
thejui think what kezabelle was suggesting is right...clean on a form should return the cleaned_data and not cleaned_data on a particular field
kezabelleI'm gonna go out on a ;imb and say its teh cleaning data
kezabellechrist that was bad typing
kezabellesee, what theju said
kezabelleI think you're accessing a dictionary key which exists, but is empty now you've cleaned it
kezabellewherever you're returning just the single dictionary item in clean, I /think/ it needs to be the whole dictionary. Or, you change the clean method to be field specific
thejumunichlinux: in simpler words, clean should return a dictionary but you are return a value, so the unsubscriptable error, just rename the clean method to clean_photo and things will work
munichlinuxtheju, ok thanks let me try
wolfalfahi guys. when I delete a record, all the related records are deleted as well. this is by default. is there any way to avoid/override this behavior?
munichlinuxtheju, kezabelle ya it worked thanks
thejuwolfalfa: nope
wolfalfa:)
wolfalfanot encouraging
thejuwolfalfa: actually you could go through the delete method on the model and override it in your model, but it is not recommended because it doesn't make sense to have related records exist when the parent record is deleted
kezabelleI was about to say, you could override delete() and clear the related records
kezabelletheju: sometimes, it does. You shouldn't have to keep orphans around, but sometimes, to make ommelettes, you make cheese out of a terrible db schema
thejukezabelle: probably, but i would prefer to do it in the schema than in the code...anyways contexts can be different and i think the user has to decide the best path available to him
wolfalfakezabelle: now that you mention it, it makes sense to reassign the orphans to a different parent before deleting that
jtiaiAnd sometimes it's preferred not to delete parents if childs exists, just to make sure that db doesn't get poor orphans...
jtiaiThere is even ticket for that #7539.
DjangoBothttp://code.djangoproject.com/ticket/7539
FireSlashHi guys. Not sure if this is django related or something else, but I have a server that works fine, except randomly after a long time (~2 months or so) of uptime, it dies with [Errno 13] Permission denied: '/.python-eggs'
FireSlashrestarting the server fixes it and it's good for another ~2 months
FireSlashany ideas?
kyrixstrange
wolfalfaFireSlash: check if you have some update/upgrade code running somewhere? apt / yum / similar
FireSlashThey're not. We do our updates on specific days, the schedulers are all off
kyrixFireSlash, whats the memory usage while its hanging?
FireSlash366 or so free, and over a gig of unused swap
kyrixFireSlash, whats the platform/setup etc
LiberumIt seems that the solutions available for translation of individual fields in contents are either terribly incomplete, non-idiomatic or require you to specify the languages to translate to in advance. Do I need to fork or roll my own in order to get a translation system that supports definition of languages on the fly?
kyrixLiberum, afaik, yes
Liberumdjango-modeltranslation looks terribly good, by the way, apart from requiring definition of languages as a part of server configuration.
Liberumkyrix: Thanks.
kyrixLiberum, but probably not very hard to implement
FireSlashRHEL 64 bit, not sure on the exact django version since we've upgraded it a few times to sort out some sql issues, but it's .9x
kyrixFireSlash, wsgi apache... ?
FireSlashapache, mod_python
Liberumkyrix: My thoughts exactly, although I would have liked to be on a standard path. Maybe contact django-modeltranslation author and suggest a fork.
diofeherhey ppl, what happened to djangopeople.com?
FireSlashalso python 2.3
thejudiofeher: did you mean djangopeople.net?
kyrixdiofeher, no idea, dns down it seems
edgarallanpoehow do i find all model instances where timestamp != None?
kyrixFireSlash, do you got full access to server?
FireSlashkyrix, Yeah.
jtiaiedgarallanpoe: you mean .filter(timestamp_isnull=False)?
kyrixFireSlash, ok, first question, any reason to be using modpython instead of wsgi?
edgarallanpoejtiai that worked for me thanks
kyrixLiberum, let me know if you do anything. id be interested in helping out
FireSlashI didn't do the original setup on this server, but I don't think WSGI was "ready" when this server was originally setup.
edgarallanpoejtiai is there a more generic way to negate the comparison in the django orm? if i wanted to find all articles that were NOT written in the month of february, for example?
FireSlashThere hasn't been a compelling reason to switch away from mod_python, so we've been using it since.
edgarallanpoebasically a way to say "!=" in the model query to any comparison?
jtiaiedgarallanpoe: Q queries.
kyrixFireSlash, ok. To me it seems like a complicated problem, as the problem could be anywhere (from the app down to apache or filesystem)
kyrixFireSlash, so I would try isolating the error slowly.
FireSlashHmm, just got odder too. The error changed to ImportError: cannot import name connection
edgarallanpoehmm, just googled "q queries" but didn't return much, can you either point me in the right direction to find out more about q queries or just show me an example?
kyrixedgarallanpoe, look at the official docs
diofehertheju: yep, djangopeople.net! :P
kyrixand its Q queries, not q queries :)
FireSlashkyrix, Ok. That was my plan, I was just hoping someone else might have seen it before :)
jtiaiedgarallanpoe: http://docs.djangoproject.com/en/1.1/topics/db/queries/#complex-lookups-with-q-objects
thejudiofeher: the domain name expired
edgarallanpoethanks jtiai
diofehertheju: oh, i see...
kyrixFireSlash, i would start with a filesystem monitor to see if permissions change
thejudiofeher: just tweeted to simonw about this...you should check his reply soon
kyrixsomehow
kyrixedgarallanpoe, btw. when u google use the keyword django too.
kyrixor +django is better
FireSlashkyrix, I already checked the permissions on that folder while it was giving the permissions error, they were correct
edgarallanpoeok thanks kyrix
FireSlashAt which point I get to file a report to my boss about the gremlins in one django server. :3
kyrixFireSlash, then i would try setting up a virtualenv without dist for your django app
kyrixand see how that goes
ironfroggyI've seen so many conflicting usage patterns i can never be sure, are having apps in non-toplevels supported by django or simply accidentally working?
kezabelleshould be able to have them anywhere on the python path, IIRC
kyrixironfroggy, apps in non-top levels? as long as they are on the path.... they can be anywhere
FireSlashkyrix, Already have one. Though it doesn't see much traffic since we only use it for dev purposes, it works fine. This doesn't whitelist the code though, due to the lack of traffic
FireSlashI might just swap them out for a month and see what happens though
kyrixFireSlash, can u try to stresstest it?
kyrixor swap :D
ironfroggykyrix: things like, "company.internal_app" in INSTALLED_APPS are supposed to work?
FireSlashI've tried a few scenarios, but the stresstest didn't prove anything other than we paid too much for that server :P
kyrixironfroggy, of course
kezabelleironfroggy:  yes
diofehertheju: ok! i'm following u there :P
ironfroggyi just hit a snag with such an app being used as the AUTH_PROFILE_MODULE
ironfroggyactually i might have not looked at this correctly....
joe4444how can i avoid evaluating this query four times? i thought django evaluates it once on h.count() then uses cache for the rest, but this code takes 4 times longer than expected. http://dpaste.com/140933/
kezabelleyou'll have made the mistake everyone does, ironfroggy ;)
kyrixkezabelle, it took me a while to truly understand path, and it still makes me wonder sometimes ;)
kezabellethat it points at the whole module
ironfroggyok this is the part where i get unsure this is supposed to be allowed
jtiaijoe4444: Because you do it all wrong :D
kezabelleso for example, mine is
thejujoe4444: count only does a select count()...it does not evaluate
kezabelle"profiles.Profile" (a model)
jtiaijoe4444: and every "index" fetch is actually slice generating _new_ queryset.
kezabelleyou don't actually put models in, I can't really remember why
thejujoe4444: if you want to evaluate it...use len() or list
ironfroggybecause the applabel is the module, not the qualified path. so you can technically have foo.bar and baz.bar as two apps, but now you can't refer to them correctly in places that take an applabel
Liberumkyrix: I will. I'm gonna look around and maybe create an implementation draft. Message me your e-mail and I'll be in touch today or tomorrow.
kezabelleironfroggy:  yes
kyrixLiberum, now that django people is down... where do i put my contact info? :)
ironfroggysee, i would think either applabel should include the whole path or you shouldn't be allowed to use multiple levels
ironfroggyi dont even like having this setup, but I'm stuck with it for the most part.
ironfroggyi have one that's even 4 levels deep
ironfroggyapp1.app2.app3.app4
ironfroggycleanup is too time consuming to do all at once, but i'm making inroads to correcting as much as i can
kyrixironfroggy, too many levels very evil
jtiaiironfroggy: there is some ticket about namespaces for apps too, because name conflicts and figuring out artifical names for apps is quite stupid...
kyrixironfroggy, its easier to bundle apps in projects, and never have the apps themselves on the path
kyrixironfroggy, only projects in path
joe4444i see, so really all i need to do is replace if h.count() > 0 with if len(h) > 0 and the rest will pull from cache?
kyrixironfroggy, hold on, i saw a presentation on it once
ironfroggyi wish applabels were never created. we should have two ways of identifying a package.
jtiaijoe4444: You might want to read about Django queryset evaluation...
joe4444jtiai: yeah i read it but mistakenly thought .count() evaluates
kyrixironfroggy, but we do. we have projects and apps :)
jtiaijoe4444: Well description of count tells quite exactly what it does.
kyrixwhats the site that has all the presentations?
Artis_hey, I have an error...
Artis_AttributeError: 'Manager' object has no attribute 'raw'
Artis_why?
zimnyxI want to store dictionary in a model field, any tips? (In fact I want it to be serialized before write to database, and deserialized when read from db). Any tips?
Stavroshello
kezabelleArtis_: on what code? (dpaste or pastie pls, not in here)
kyrixironfroggy, http://www.b-list.org/weblog/2006/sep/10/django-tips-laying-out-application/
fission61anyone here play around with linkedin from an api standpoint or just use it regularly? if so i have a curious question
Stavrosthis is an odd request for #django, but i would like to hire a good developer to work on a php codebase, and this is where the good developer are... is anyone interested?
kezabellezimnyx: tried looking at the serializers docs?
joe4444jtiai: well i read an example showing how the first time a qs is evaluated each successive "fetch" is from cache... and i assumed .count() was evaluating, but of course it makes much more sense that it does not b/c it's SELECT COUNT() rather than SELECT *
kyrixironfroggy, http://www.youtube.com/watch?v=A-S0tqpPga4
kezabellezimnyx: or maybe even just pickle?
jtiaizimnyx: django-command-extensions might had a pickledfield...
jtiaizimnyx: Well, it had "JsonField" that actually serializes data to json..
kyrixStavros, are you paying $300 the hour? then i might think of using php again ;)
Popular searches: set the superuser password in murmur   Waiting for release of fcntl lock on   unterschied mumble mumble11x   onBlur click jacking   goleif erfahrung   AMD raid Task 20 timeout   

Generated by irclog2html.pl 2.1mg by Jeff Waugh - return