Is there a way to filter by values in my template? I'm sorting contacts by unique addresses, but then i want to list the people who live at each address (assuming there can be multiple people at a given address). Right now I'm passing the list of unique addresses and the list of all contacts to my template.
briancray has quit
PKKid
caruso_g, Firefx is being picky and hates that I defined my file type as "text/less" instead of "text/css" -- annoying FF.. :-P
caruso_g, Im more of a backend guy, my design skills are not so great yet. :)
andredieb has quit
andredieb joined the channel
natea_ joined the channel
exit2, It depends on what you would consider "Same" setting. basically you do something like "Try to get a setting with attributes xyz, if nothing it returned in that queryset, then create a new one"
caruso_g
PKKid: that would be a good collaboration. :) Contact me if you fancy. twitter: @bonsaistudio
Guddu: that looks like you're getting an extra null in the file, or is entire contents a null?
Guddu
iiie, Entire content is not null....But I am not sure what extra null is it validating
exit2
PKKid: right more or less, check if it exists, if so - do not do anything, if it does not exist, update existing. I just want it to be one single entry in that table the whole time.
PKKid
caruso_g, Sounds good. :D -- also feel free to catch me on GChat anytime: mjs7231 _at_ gmail
greg_f has quit
natea has quit
natea_ is now known as natea
kenbolton joined the channel
iiie
Guddu: the contains NULL byte is an exception from the csv library, I'd try a little debugging to look for nulls and count lines (not actually process for csv and see if the delimiters or terminator (EOF -- often NULL) is getting in there)
Guddu
Thanks iiie Will try debugging
anth0ny joined the channel
iiie, It so turns out that i cannot write tempfiles either
SuspiciousOperation at /receiving/bulk_receiving/
Attempted access to 'c:\windows\temp\tmponk6wn.xls' denied.
cyborg-one joined the channel
caruso_g
PKKid: thanks, gonna add it, thanks.
PKKid: dinner time, thanks again for your help
iiie
Guddu: fun, if you're running under runserver, you can just print (to stdout, sorry all, yes it's a bad practice, but it does get the job done)
I need a template to extend a specific template due to a condition; is this correct? http://dpaste.com/794358/
anuvrat
Guddu: are you trying to upload the xls?
iiie
Guddu: SuspiciousOperation here just means that your code tried to read (or write) to a file that the process didn't have permissions to
Guddu
path = safe_join(self.location, name)
anuvrat, Yes. uploading a .xls and trying to store it on disk so that XLRD can open it using open_workbook
anuvrat
Guddu: store it in a location you can read / write to
Guddu
anuvrat, I was using tempfile
anuvrat
Guddu: you wont have permissions to the tmp directory on the server, usually
hhatch has quit
Guddu: its writing to windows/temp ... I am sure windows would not let you read write there
Guddu
anuvrat, What is the general way to get around this?
anuvrat
Guddu: create a directory elsewhere, write your file there and then try reading
Guddu
anuvrat, On Unix based systems also I can't write to tmp?
palli joined the channel
anuvrat
Guddu: as I said usually you can't write to tmp, or rather django can't write to temp unless you explicitly change the permissions
Guddu
Thanks anuvrat I will write to a regular directory folder and see
anuvrat
Guddu: which you can easily do via chmod, if you are running your program on a VPS ... on a shared hosting that won't be possible
Guddu: you're welcome
palli
I want my form to be bound when doing get (so validation will run on the initial values). But (of course) when i run f = Myform(initial=request.GET, data=request.GET) i get empty values in all the fields instead of the form defined initial values.
I do get B.xls created...But not A.xls....this is because of that suspicious operation.....
I looked at C:\\Python27\\lib\\site-packages\\django\\core\\files\\storage.py and it is failing at this line
path = safe_join(self.location, name)
jroll|dupe joined the channel
anuvrat, Further digging reveals that self.location is coming as F:\\Program Files\\Apache Software Foundation\\Apache2.2 and name as C:\\A.xls
jroll has quit
mucker has quit
XofP joined the channel
anuvrat
Guddu: oh ... thats weird
Guddu: btw, I had just used os.path.join
Mohsen_Hassani has quit
fgallina joined the channel
Guddu: in that case what is the value of the path?
dmclain
Guddu anuvrat that behavior is very expected, the storage system is supposed to protect you from things like a user figuring out how to write files to a completely different drive from the location that the storage is configured for
the default storage is configured to write files to F:\\Program Files\\Apache Software Foundation\\Apache2.2
so asking it to write a file to the C: drive would be something that it should prrevent
citadelgrad joined the channel
CRF_H0M3R has quit
if you want to have default storage somewhere else it can be configured using settings.DEFAULT_FILE_STORAGE
atula has quit
pustynnikov joined the channel
kojiro has quit
n3storm joined the channel
Guddu it's also worth pointing out that the inside of the Apache2.2 program install is probably not a great place for DEFAULT_FILE_STORAGE to be either
les_sylvains joined the channel
juliaelman has quit
actually, i think now i'm misreading the docs/code
atula joined the channel
fgallina has quit
DEFAULT_FILE_STORAGE would use a different storage class
PKKid
exit2, Did you figure out your issues?
dmclain
but the file system storage class defaults to your MEDIA_ROOT if location wasn't specified
Coalpaw has quit
so Guddu, you should specify MEDIA_ROOT as a directory where you have read/write access and that XLRD can access too
since the default MEDIA_ROOT of blank is defaulting to the Apache install directory