Hi,
The following code fails on windows, and works just fine on my unix
box. To fix the problem in windows, I must replace('%', '%%') so its
internal string formatting doesn't fail on me. Should I file this bug
for psycopg2?
from django.db import connection
cursor=connection.cursor()
cursor.exec
ind on "def do_if(parser, token):" -- check out how the if tag
> has been written.
>
> Erik
>
> On 19.10.2008, at 23:24, Siah wrote:
>
>
>
> > Hi,
>
> > I can't understand how template tags such as if, for and ifequal
> > manage to have an a
Hi,
I can't understand how template tags such as if, for and ifequal
manage to have an accompanying endif, endfor and endifequal, and I
can't have it. Or I can't manage to find out how to do it. So, I
basically want to do something like:
{% customTag %} hello {% endcustomTag %}
and within my cu
Hi,
My django app must serve multiple domain names. I also have a need to
have my session available on my domain and subdomains. So, reading up
on Django docs, I realized I have to do this:
SESSION_COOKIE_DOMAIN = '.mysite.com'
So, my question is: How do I have my sub-domains share the same coo
>
> On Jun 6, 8:42 pm, Siah <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I need to select different urlpatterns in my middleware's
> > process_request hook. The docs say, process_request is called -before-
> > the appropriate view is selected, which shou
Hi,
I need to select different urlpatterns in my middleware's
process_request hook. The docs say, process_request is called -before-
the appropriate view is selected, which should mean there must be a
way for me to tell django to use a different urlpatterns. I checked on
CommonMiddleware that doe
Thanks everyone,
Once again, I do not expect to know the record's ID before having
saved it. But once I save it, that object DOES HAVE an id. I am
assuming it was a simple insert command underneath, but do not know
how this DB assigned is has become visible to Django. The django code
representing
or not to do an insert or update.
>
> -richard
>
> On Sep 23, 2007, at 9:38 AM, Alex Koshelev wrote:
>
>
>
> > I think that when you create Product object django inserts new row
> > into database and retrieves with SELECT new id.
>
> > On 23 сент, 16:0
Hi,
When in a model you run something like this:
>> obj = Product(name='Apple')
>> obj.id
4
I realize the first statement will turn into an insert table. But, how
does django know of its newly assigned primary key(ID).
I have a legacy database whose ID is assigned with an after trigger,
and am
Hi,
I have a many to many relationships between Model1 and Model2. So
django gives me the ability to add an object of Model2 to Model1 as
follows:
Model1_Object.model2_set.add( model2_Object )
Now, I need to have some clean up done once the above takes place. So,
i was considering overriding th
Hi,
I need to hide referrer url on HttpResponseRedirect. I was expecting to
find something like ReferrerURL in HttpResponseRedirect.headers, but
did not. I was hopping to change the header information right before
HttpResponseRedirect sends the user to the other server to hide the
referrer URL, o
Per connection? Does it mean per request, or page view?
I tried increasing the number of postgres connections, and it ended up
completely killing the server. The server I'm working with has 2 django
sites running, one of which receives around 3M hits a month. The other
one somewhere around 200K h
Hello,
I am running django on heavy load server, and multiple times a week I
have my postgres crashing due to high server load. When I get TOP, I
see many many postmasters running at the same time, until I get 'Too
many connections' postgres failiour error from postmaster emailed to me
from djang
Hello,
Given this model:
class Person(models.Model):
name = models.CharField(maxlength=200)
children = models.ManyToManyField('self')
I can do:
FatherObj.children.add(ChildObj)
Somehow though, if I go to ChildObj and ask for its children, I will
get the FatherObj as well. What am I
Thanks you guys.
Sia
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PRO
I can think of instances where you would need multiple copies of a
given block. For instance, I am want to show a page counter (Page 1,
(2), 3, 4, 5, 6) both on top and bottom of my page. I had to use the {%
include %} tag twice to load it. Except, I realized I want my template
for both standard v
Thanks for the response adrian.
Somehow I felt the result of Alter Table is not as efficient as
properly creating the table in the first place. If I'm incorrect, that
I think I am, your suggestion is actually very good and should make my
life more efficient.
I guess if I go with above, I don't h
I am 7 months into coding a large django application. Due to needing
extra bytea fields with my database, I started maintaining my own SQL
instead of django-admin install app. Everytime I made changes to my
model, I would take django-admin sqlall app and apply those changes.
Its been a few days I'
Good work.
Sia
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
Reviewing my own application, I realized there are much my view has to
take care of that doesn't need to delay HttpResponse to the user.
For instance, I need to
- extract the newly uploaded PDF file to extract and index its text.
- create PDF docs for new orders
- Resize uploaded image, etc
All
John,
I had the same problem and chose to ignore it. I think it might be a
bug with Django.
Regards,
Sia
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to d
Thanks Michael,
I did it all, non seems to help. Its wired that I am the only one with
this problem. I am thinking of reconfiguring my site in hope of having
this problem go away.
Thanks,
Sia
--~--~-~--~~~---~--~~
You received this message because you are subscr
Thank you Michael,
I must add that on my laptop using django's runserver command, this
problem does not exist.
Moreover, my settings.py middlewares are default installation and holds
no information in regard to caching:
MIDDLEWARE_CLASSES = (
"django.middleware.common.CommonMiddleware",
I don't think that's it. My django site is very generic. It has to be
some sort of configuration I am missing.
Any other ideas?
Thanks,
Sia
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
T
I just launched my django site for a client. My problem is something
is caching my db data in a bizzar way. Here are some of the behaviours
I get:
- I login, and every other page it makes me login again for a 5 minutes
or so and then it remembers that I am logged in.
- I add a record, it refl
I see.
Thanks,
Sia
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTE
heh.. It works except I am using psycopg.Binary(somebinarystructure),
and I am not really doing it by hand to just add the extra %, and
psycopg.Binary doesn't do it. I'd imagine it's a bug with psycopg
package. Any quick way to project a string from freak '%' problems?
Thanks,
Sia
--~--~--
It seems like a freak problem to me. I spent a long hour to track the
problem down and here it is:
The following statement fails because it has the '%' sign in it.
cursor.execute("select '%'")
The error is: IndexError: list index out of range
How do I address this problem?
Please note that th
True, python objects are very useful all by themselves. I think I still
can get away with DB objects, by regularly updating them, never using
session DB objects for insert/update and even monitoring reads on what
value is being used.
I have not yet utilized the caching system as I thought it is i
Thanks John,
It is extremely tempting to place objects in sessions though. I'm
pretty sure I'll still use it to a safe extent.
Thanks,
Sia
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To p
I used to think I can't and it is a bad practice to place objects
(non-strings) in django sessions.
I just realized I can, but I don't know if it's a good practice. Some
feedback in this regard is appreciated,
Thanks,
Sia
--~--~-~--~~~---~--~~
You received this
Just incase I wasn't clear, in case I don't refresh the object the
error indicates that it can't save the object with 'None' for its
created date field. That is, when the object was added, its created
date field was not populated.
Sia
--~--~-~--~~~---~--~~
You r
Hi,
On the following model:
class Object(meta.Model):
created = meta.DateTimeField(auto_now_add=True)
account = meta.ForeignKey(Account)
title = meta.CharField(maxlength=200)
...
When I do:
new_object = account_obj.add_object(title='foo')
My new_object.title=='foo' is True, but
emm.. But wait a sec! How do I call a python function from django
template. I don't think it is allowed, meaning that I'd still have to
write a filter using textwrap:
>>> wrap('siasookhteh', 5)
['siaso', 'okhte', 'h']
Sia -
--~--~-~--~~~---~--~~
You received thi
Thanks David. I did feel there should be a way to do this since it
seems common enough.
I'll read up on textwrap now,
Regards,
Sia
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to th
Hi,
I noticed there is no filter to truncate a string to a given number of
characters as apposed to just words. It can be useful. For instance I
am trying to show contact list that includes email addresses, and given
that some people have bizarrely long emails, I'd like to limit it to
some value.
Hi,
I will be creating my custom manipulator dynamically, so I don't know
what fields I have, and I simply want to iterate through them in my
templates? Doing a simple:
{% for a in form %}
{{ a}}
{% endfor %}
doesn't work...
Any ideas?
Thanks,
Sia
--~--~-~--~~~--
Thanks for the help. I figured if I place the module out of my
myproject directory, I can import it. I'll do that for now until 9.2
comes out.
Regards,
Sia
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django u
Probably simple, but this is a problem I cannot figure out.
Under my django project directory I have a folder called 'utility':
- myproject
- urls.py
- settings.py
- manage.py
- __init__.py
- apps
- - polls
- utility
__init__.py
utilityfunction
Reading up on transaction, I figured I have to commit it, except
cursor.commit() gives me this error:
Error: serialized connection: cannot commit on this cursor
Any ideas?
Sia
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Goog
Hi,
Some may call this a feature, I call it a bug:
If I do:
cursor = db.cursor()
cursor.execute("insert into tablename values(5,'somename')")
It will work without giving me an error. Even if I run a select
statement within the same session, it would confirm that that record
was entered. But, my
Russ,
I see the priorities. I'm going to go ahead with a single db for now,
hopefully by the time I launch it the feature is out and I would rework
some of the necessary changes.
Thanks,
Sia
Hi,
I am aware that there is a ticket for it:
http://code.djangoproject.com/ticket/1142
I was wondering if the wrapper was small enough that can be squeezed by
in version 9.2 or anytime soon as I am in desperate need to use it.
Specifically, to separate cheap data from expensive data.
Thanks fo
Jonathan,
Don't be unkind to my schema.
I enjoyed your blog though.
Sia
Please excuse the lack of applicability for this example. It was meant
to serve as an example, apparently not a good one.
In my database, I have tons of such relationships. I have a Person
model having foreign keys to django authentication user model, to the
current branch he resides (a foreignke
The title should say: deletes, not delets
Hey Todd,
I am working on a large web app with django and backward
incompatibility issues shows up on my nightmares from time to time.
I would say start your app with the latest version of SVN and always
keep it updated. On every SVN update read backward incompatible changes
(http://code.djangop
Hi,
I have a model similar to:
class Phone(meta.Model):
number = meta.CharField(maxlength=50, null=True)
class Contact(meta.Model):
phone = meta.ForeignKey(Phone, null=True)
name = meta.CharField(maxlength=200)
After I have data in, I want to be able to delete a contact's phone. As
Thanks Adrian.
My main concern was with speed, and I'm glad that's not the case.
Regards,
Sia
Hi,
I have lots of views. So, I separated them into sections. I want to
package them together with the views they are associated with. Is it
incorrect design decision to place my URLs in the same file as my View?
Does it make it any slower? What about my manipulators + views + URL in
the same fil
50 matches
Mail list logo