I have a field with the null=True option
How do I test for the Null value in template?
I did something like:
{% ifequal field Null %}
do something
{% else %}
do something else
I tested it and it worked. But I want to make sure this is the proper
way to handle Null value in Django. The d
Can anyone help me with the following point?
Does django keep internal state when psycopg throws a
OperationalError, and how do I clear it?
The situation is this: I have external processes writing into a django/
postgres database. To avoid using semaphors, etc, I'm trying to use a
row level lock
Thanks for the reply. I'm still working with this and have it working
in cases of editing records but when I try to create a new record it
throws an error as would be expected since there's no instance to read
the initial values from. I tried putting an is_bound check to give a
devault but of cou
On Dec 18, 3:57 pm, Info Cascade wrote:
> Dan,
>
> This works for me -- using mod_python.
>
> VirtualHost defininition:> SetEnv VIRTUAL_HOST_NAME dev.hostname.com
> > SetEnv DATABASE_NAME dbname
> settings.py:
> > VIRTUAL_HOST_NAME = os.environ.get('VIRTUAL_HOST_NAME')
> > DATABASE_NAME = os
Dan,
This works for me -- using mod_python.
VirtualHost defininition:
> SetEnv VIRTUAL_HOST_NAME dev.hostname.com
> SetEnv DATABASE_NAME dbname
settings.py:
> VIRTUAL_HOST_NAME = os.environ.get('VIRTUAL_HOST_NAME')
> DATABASE_NAME = os.environ.get('DATABASE_NAME')
Liam
Dashdrum wrote:
> I'm
Diego,
Which version of Django are you using?
I remember a refactor of m2m landed recently as part of Alex's GSoC project.
[1]
Just my 2 Colombian Pesos.
[1] http://www.pubbs.net/django/200910/58391/
On Thu, Dec 17, 2009 at 5:51 PM, Diego Andrés Sanabria Martin (diegueus9) <
diegue...@gmail.co
its because you set DEBUG=False
and on your templates dir not exist the file 500.html
On Thu, Dec 17, 2009 at 7:34 PM, reactosguy wrote:
> I get this message every time I go on http://localhost:8000/ with the
> Django server running:
>
> Traceback (most recent call last):
>
> File "C:\Python26\
I get this message every time I go on http://localhost:8000/ with the
Django server running:
Traceback (most recent call last):
File "C:\Python26\lib\site-packages\django\core\servers
\basehttp.py", line 279, in run
self.result = application(self.environ, self.start_response)
File "C:\Py
Wayne wrote:
> Hi,
>
> I tried to use djando-ldap-groups but got some errors from database
> configuration. Could somebody shed some light on the possible problems
> of my set up?
>
Maybe the Oracle API is translating the PK into a LOB? If LOB is a large
object then that is probably the issue
Hi,
I tried to use djando-ldap-groups but got some errors from database
configuration. Could somebody shed some light on the possible problems
of my set up?
Thanks,
Our LDAP server is Sun One Server and the site is running in the
windows environment.
The settings.py file:
LDAP_SERVER = 'directo
2009/12/17 Andrew :
> Thanks guys for all the commentsIm on ubuntu on eclipse and there
> was no local history alas
>
> Thems the breaks when you omit to submit ;-) ... to source control...
>
> I used UnPyc to disassemble the .pyc and I am now rewriting the python
> using the assembly as a
I found the answer in this discussion:
http://groups.google.com/group/django-users/browse_frm/thread/184e5e09db1efce4/7816cbc650d8dc77
Pass in the filename and content to the FileField's save() method
directly, rather than using the model instance's save() method.
On Dec 14, 2:24 pm, Brian S wr
Make sure you started a project first:
django-admin.py startproject myapp
cd myapp
vi settings.py
On Thu, Dec 17, 2009 at 4:01 PM, reactosguy wrote:
> Where is the Django settings file? I read the docs but I am confused.
>
> --
>
> You received this message because you are subscribed to the Goo
In your root dir for your Django project normally. settings.py Not in
the django root if that is your confusion
On Dec 17, 6:01 pm, reactosguy wrote:
> Where is the Django settings file? I read the docs but I am confused.
--
You received this message because you are subscribed to the Google Gro
Where is the Django settings file? I read the docs but I am confused.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users
Thanks guys for all the commentsIm on ubuntu on eclipse and there
was no local history alas
Thems the breaks when you omit to submit ;-) ... to source control...
I used UnPyc to disassemble the .pyc and I am now rewriting the python
using the assembly as a guide. Good think I did mainfram
Hi,
I'ḿ having issues with ManytoMany Relationships that are not updating
in a model when I save it (via the admin) and try to use the new value within a
function attached to the post_save signal or within the save_model of
the associated AdminModel.
I've tried to reload the object within those fu
There are some audit trail stuff available for Django
http://code.google.com/p/fullhistory/
http://code.djangoproject.com/wiki/AuditTrail
-Sid
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@g
I have my class definition that looks like
class Foo:
def get_bars(self):
bars = []
# do something to collect bar instances
return bars
bars = property(get_bars)
in my template, I'd like to do something like this:
{% for bar in foo.bars %}
{{bar.snafu}}
{% endfor %}
Thanks! My comparison of Django and Ruby on Rails was definitely more
subjective than objective. Although I read several good articles that
had more objective metrics to compare Ruby and Python speed, I did not
run those kinds of tests myself. My approach was more about gathering
the information th
The name of the byte code disassembler is dis, and it's part of the
standard python install in 2.4, 2.5, 2.6, and 3.0 (the ones I have
handy to test with) and will be documented in the default docs. You
can confirm that you have it by trying "import dis".
On Thu, Dec 17, 2009 at 2:45 PM, Shawn Mi
This won't help you unless there's something you forgot about, but it could
help you in the future. In addition to git, I also use JungleDisk. It backs up
my entire projects folder every hour. Perhaps you have Carbonite, JungleDisk,
Mozy, or one of those services and you might be able to recover
On Thu Dec 17 11:28 , Bill Freeman sent:
>I saw a demo of a byte code disassembler once. It won't get you the
>source code back, but you could conceivably construct equivalent from
>it. You can, for example, see what it's calling, and sketch out the
>contiditionals and any loops. You could g
I saw a demo of a byte code disassembler once. It won't get you the
source code back, but you could conceivably construct equivalent from
it. You can, for example, see what it's calling, and sketch out the
contiditionals and any loops. You could google for it, or ask on the
python tutor mailing
Thanks to both responders for the explanations.
Dan
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@goog
Hi guys,
Ok...firstly me bad ... I didn't check into my source control which
was stupid. So if I can close that book ;-)
I am looking for a decompiler for my views.pyc ... Im using django
1.1.1 and python 2.6.2 ... I have tried UnPyc but fails.
Has anyone successfully found a 2.6 decompiler ?
Th
Hello,
I'm new to django, and am just going through the tutorial (on Mac Os X
10.4.11, installed latest stable version from tarball).
All seems to go well until I enter the damin login nd passwd, after
which the development server just exits without notice.
I've traced this back to autoreload.py
Okay, let me further explain my problem...
My website depends heavilly on the caching system, I'm using cache_page to
cache my view ( using memcached backend ),
however I have the "Hello, " on top of every page when the
user is logged, thus I cant just cache everything.
So I began experimenting
I know this is VERY basic, but I am NOT a programmer or web designer -
I am just trying to maintain and update the site.
I am having a problem inserting/editing a pdf to the site. It's a
basic pdf, no report generation, etc. I am trying to insert the pdf to
a flat page in the:
General
Image/URL
In my root urls.py I have the following:
urlpatterns = patterns('',
(r'^', include('story.urls')),
)
In my story app, I have the following urls.py:
urlpatterns = patterns('',
url(r'^$', home_view, name='story-home'),
url(r'^create/$', home_view, name='story-create'),
)
Running on th
Victor Loureiro Lima wrote:.
> auth system is in fact invalidating my current session id cookie, but
> afterwards it sets a new session id cookie, why does it do that?
>
Um. So that anonymous users of your site still have sessions? Django
supports "anonymous sessions", sessions and auth are diffe
On Dec 16, 9:47 pm, mtnpaul wrote:
> I'm not looking for an answer, just thought I would post this problem
> so if someone else gets it they'll have one place to look anyways.
>
> I had a model with some field names greater than 31 characters. Since
> most databases restrict column name length to
On Thu, Dec 17, 2009 at 10:12 AM, Wiiboy wrote:
> I like to use Kate (KDE's default text editor). It has auto-indent,
> and syntax highlighting for Python, and Django templates.
another vote for Kate, and the best part is that it's a KPart, so the
same engine can be used right within the file br
I like to use Kate (KDE's default text editor). It has auto-indent,
and syntax highlighting for Python, and Django templates.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To
I have a question about django's session/auth system and its logout method.
Whenever I want to invalidate a user session ( i.e.: calling
auth.logout(request)), django
auth system is in fact invalidating my current session id cookie, but
afterwards it sets a new session id cookie, why does it do tha
Hi Jason, the site looks very nice.
I also found your blog posting regarding Django vs Ruby very
interesting, if I may ask, did you make some metrics to determine how
faster Python can be over Ruby?
Also, this might be a lot to ask but ... what kind of infrastructure
do you use to support your sit
On Thu, Dec 17, 2009 at 12:58 PM, Ales Zoulek wrote:
>
>> The entire point of using a generator driven response is to avoid
>> blocking until the entire response is generated, so going through the
>> response.content property would not be useful.
>>
>
> Using your patch the respose will be blockin
Let's see. We started on the Django version in mid-October...so right
at 2 months from first code until now. Luke had used Django on a few
projects before this one, but the past two months have been my
introduction to Django. I really like it - especially compared with
some of the PHP frameworks I
Ulipad: it is light, it has nice features, it is developed with
pythonwhat else ?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email
Hello everyone. Making well-structured websites on Django is a very
comprehensive process. All these blogs, news, user-related stuff -
easy. But what about, say, corporate website? I mean I got a project
to do, thought it would be great to base it on Django as usual, but...
Look at the structure,
On Thu, Dec 17, 2009 at 7:58 AM, Ales Zoulek wrote:
>
> The entire point of using a generator driven response is to avoid
>> blocking until the entire response is generated, so going through the
>> response.content property would not be useful.
>>
>>
> Using your patch the respose will be blockin
> The entire point of using a generator driven response is to avoid
> blocking until the entire response is generated, so going through the
> response.content property would not be useful.
>
>
Using your patch the respose will be blocking as well. The block wil just
happen a bit later in middleware
I'm not sure about the history but in general, it should. You can import and
reuse any form widget admin defines.
A.
Dne 17.12.2009 12:36 "Yusuf Mohsinally" napsal/a:
thanks. is there a way for me to easily include the different things
from the admin site, like "history", form field widgets (da
thanks. is there a way for me to easily include the different things
from the admin site, like "history", form field widgets (date picker),
etc. in my own app?
On Thu, Dec 17, 2009 at 12:50 AM, Ales Zoulek wrote:
> It realy depends on the level of customisation you'll need.
> From my experien
Thanks Daniel
Yes, it was multiple keys not just 'department'.
Will have a go and do some more reading on lambda.
cheers
-sam
On Thu, Dec 17, 2009 at 8:38 PM, Daniel Roseman wrote:
> On Dec 17, 6:23 am, Sam Walters wrote:
>> Hi I have been reading stuff like:
>>
>> http://wiki.python.org/moin/
On Thu, Dec 17, 2009 at 6:42 PM, Daniel Roseman wrote:
> On Dec 17, 10:10 am, gganesh wrote:
>> hi group,
>> How to compare date field types in a template ,a have field due_on
>> taking DateField type .I have to compare to present date .I have tried
>> the following in vain ,please help
>> In a
On Dec 17, 10:10 am, gganesh wrote:
> hi group,
> How to compare date field types in a template ,a have field due_on
> taking DateField type .I have to compare to present date .I have tried
> the following in vain ,please help
> In a template
> {% if enquiry.due_on >= datetime.datetime.today %} .
On Wed, Dec 16, 2009 at 9:01 PM, Ales Zoulek wrote:
> Obviously you need to pickle the whole generated data, not just generators.
> 1] But I'd use response.content propery that returns the string no matter
> how the request is created.
> 2] Subclassing the cache middleware, or creating your own de
hi group,
How to compare date field types in a template ,a have field due_on
taking DateField type .I have to compare to present date .I have tried
the following in vain ,please help
In a template
{% if enquiry.due_on >= datetime.datetime.today %} .{% end if %}
and
{% if enquiry.due_on__gt dat
On 16 déc, 22:35, Bill Freeman wrote:
(snip helpful technical answer)
> But. java practice notwithstanding, there is nothing wrong with having
> several models in one models.py module, so why fight against the
> design of django? If your collection of models is truly so complex
> that they should
Thanks a lot.
That works.
Great.
On Dec 16, 5:07 pm, Shawn Milochik wrote:
> You can do it easily with middleware.
>
> Here's what I wrote for this exact purpose:http://pastebin.com/f52e6ef04
>
> You will have to add it to MIDDLEWARE_CLASSES in your settings.py.
>
> Shawn
--
You received this
On Dec 17, 6:23 am, Sam Walters wrote:
> Hi I have been reading stuff like:
>
> http://wiki.python.org/moin/SortingListsOfDictionaries
>
> I want to sort a list of dictionaries (alphanumeric values) by
> multiple keys (achieved with code below). However I would like to
> customise the comparator t
"Looks" great, that is ^_^
On Thu, Dec 17, 2009 at 10:21 AM, OkaMthembo wrote:
> Look great, Jason. If i may ask, how long did it take from nought to
> finish?
>
> Lloyd
>
>
> On Thu, Dec 17, 2009 at 12:18 AM, Jason Ford wrote:
>
>> We just launched the public beta of FeedMagnet a few minutes a
Look great, Jason. If i may ask, how long did it take from nought to finish?
Lloyd
On Thu, Dec 17, 2009 at 12:18 AM, Jason Ford wrote:
> We just launched the public beta of FeedMagnet a few minutes ago. It
> is a Django-powered web app that helps business harness social media.
> It is essential
OK.
Try:
ls SITE-PACKAGES-DIR/django
is there a "core", "http", "forms" dirs or dirs like examples, scripts, docs
and "django"?
If it's the second case, then you need to symlink one "django" dir deeper:
unlink SITE-PACKAGES-DIR/django
ln -s `pwd`/django-trunk/django/django SITE-PACKAGES-DIR/dj
55 matches
Mail list logo