On Aug 20, 12:13 am, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Aug 20, 3:01 pm, Sasha Weberov <[EMAIL PROTECTED]> wrote:
>
> > Is it normal to experience a sudden sharp spike in cpu and memory
> > usage for about a minute or so after a start/stop and restart? I'm
> > running the pre-fork
Guys
I spent quite a while yesterday reading through the newforms section
of the docs, and thought I'd taken everything in.
As a python novice, I wrote a test script and couldn't replicate the
error, so was beginning to wonder whether I was cracking up! After
reading Malcolm's (comprehensive) re
There is an error that occurs occasionally and I suspect that it may
be user specific (i.e. for users with certain credentials).
I need to run tests in the user's context, thus, I need to emulate the
existing session of the user to test this.
I have the session id of the user that faced the erro
On Mon, 2007-08-20 at 09:13 +, omat wrote:
> There is an error that occurs occasionally and I suspect that it may
> be user specific (i.e. for users with certain credentials).
>
> I need to run tests in the user's context, thus, I need to emulate the
> existing session of the user to test thi
how do I truncate a string (in the template) after a certain amount
of characters?
I know there´s a truncate-filter, but it works with words and not
characters.
thanks,
patrick
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Go
Thanks for the reply...
I used the existing database instead of the test database to hook to
the user's session like this:
from django.test.client import Client
from django.contrib.sessions.models import Session
client = Client()
client.session = Session.objects.get(session_key = key_from_trace
On Mon, 2007-08-20 at 09:57 +, omat wrote:
> Thanks for the reply...
>
> I used the existing database instead of the test database to hook to
> the user's session like this:
>
> from django.test.client import Client
> from django.contrib.sessions.models import Session
>
> client = Client()
Hi all,
I'm trying to migrate my Django project from dev. server to Apache on
the same machine running Windows. Content generated by Django is OK,
but no static file from DocumentRoot is served.
My Apache & mod-python is configured this way:
SetHandler python-program
PythonHandler djan
2007/8/20, patrickk <[EMAIL PROTECTED]>:
> how do I truncate a string (in the template) after a certain amount
> of characters?
It's not difficult to create custom filters. For example
from django.template import Library
register = Library()
@register.filter
def truncate(value, arg):
try:
On Mon, 2007-08-20 at 12:17 +0200, Peter Melvyn wrote:
> Hi all,
>
> I'm trying to migrate my Django project from dev. server to Apache on
> the same machine running Windows. Content generated by Django is OK,
> but no static file from DocumentRoot is served.
>
> My Apache & mod-python is config
On Mon, 2007-08-20 at 11:52 +0200, patrickk wrote:
> how do I truncate a string (in the template) after a certain amount
> of characters?
> I know there´s a truncate-filter, but it works with words and not
> characters.
There's #5025 in Trac.
This shouldn't be seen as any endorsement for th
I am using the api via shell (i.e.: python manage.py shell) as
follows:
>>> from django.contrib.sessions.middleware import SessionWrapper
>>> from django.test.client import Client
>>> c = Client()
>>> s = SessionWrapper('8a3dd9235b8e718c3f7e890106180528')
>>> c.session = s._session
>>> c.session
thanks.
since truncatewords and truncatewords_html are predefined filters, I
guess that truncate should also be one (just my opinion).
patrick
On 20 Aug., 12:33, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Mon, 2007-08-20 at 11:52 +0200, patrickk wrote:
> > how do I truncate a string (in
On Aug 20, 5:13 pm, Sasha Weberov <[EMAIL PROTECTED]> wrote:
> On Aug 20, 12:13 am, Graham Dumpleton <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > On Aug 20, 3:01 pm, Sasha Weberov <[EMAIL PROTECTED]> wrote:
>
> > > Is it normal to experience a sudden sharp spike in cpu and memory
> > > usage for about a
If I am not missing something, it looks like I have solved the
problem.
This is hack:
>>> from django.http import SimpleCookie
>>> from django.test.client import Client
>>> c = Client()
>>> cookies = SimpleCookie()
>>> cookies['sessionid'] = '8a3dd9235b8e718c3f7e890106180528'
>>> c.cookies = coo
I'm serving rather large, static files through Django. I'd rather not
use renaming trickery to serve them, but I don't know what the best
way to serve them through HttpResponse is. I used to use this:
response = HttpResponse(iter(open(file_path, "rb")))
return response
in my view. That stopped w
First of all i would like to know if it is exists a way to represent
filenames in different encodings with django.
Seems i've tried everything, but cannot get rid of UnicodeDecodeError/
UnicodeEncodeError messages.
There is my view:
from django.shortcuts import render_to_response
from django.uti
On Mon, 2007-08-20 at 12:46 +, imgrey wrote:
> First of all i would like to know if it is exists a way to represent
> filenames in different encodings with django.
> Seems i've tried everything, but cannot get rid of UnicodeDecodeError/
> UnicodeEncodeError messages.
You need to know the enco
{{ post.subject|slice:":15"|escape }} does the job.
On Aug 20, 6:55 am, patrickk <[EMAIL PROTECTED]> wrote:
> thanks.
>
> since truncatewords and truncatewords_html are predefined filters, I
> guess that truncate should also be one (just my opinion).
>
> patrick
>
> On 20 Aug., 12:33, Malcolm Tre
Jake,
I've made the change to where both of my fields are now of type
DecimalField. However, I'm getting the same error:
TypeError
float() argument must be a string or a number
Caught an exception while rendering: float() argument must be a string
or a number
26 {% for a in thespinfo %} #
Hello Carl Karsten!
On Sun, 19 Aug 2007 21:39:31 -0500 you wrote:
>
> Grigory Fateyev wrote:
> > Hello!
> >
> > I have simple class with ImageField, but cann't add any object:
> >
> > class Book(models.Model):
> > name = models.CharField(_('Book Title'), maxlength=200)
> > book_number
Hello everyone,
I have an application where users can upload files, mostly photos. I
wish to avoid the problem of people sending photos with the same name
and ending up with a "polluted" directory like this:
dscn0001.jpg
dscn0001_.jpg
dscn0001__.jpg
dscn0001___.jpg
dscn0001.jpg
dscn0001
As a side-project I tried to port Stellar Crisis 2.2 (a 15 year old
browser game written in the C-like langage Pike for the Roxen server)
to Django. So far, unfortunately, I failed. It seems, Django isn't the
right tool to create such kind of application :(
SC keeps all persistent data two global
On Aug 20, 1:12 pm, Ceph <[EMAIL PROTECTED]> wrote:
> The only other option I see to serving large files securely is
> trickery using dynamically created sym links to the true static file
> and then redirecting the user to those URLs and letting Apache serve
> them. This isn't as secure, though, a
Greg napisał(a):
> Jake,
> No I didn't. When I tried the 'floatformat:2' I made sure that my
> model fields were of type FloatField. When I do use the 'floatformat:
> 3' and view the template. I notice that in my error message my for
> statement is highlighted:
>
> TypeError at /rugs/milliken
I am going through the tutorial from the site, however I have named
my files a bit different. My project is named Social and my
application is named Network.
settings.py
ROOT_URLCONF = 'social.urls'
TEMPLATE_DIRS = (
"C:/python25/scripts/social/network/templates/admin",
"C:/pyt
On Mon, 2007-08-20 at 15:48 +0200, Stefan Matthias Aust wrote:
[...]
> I'd like to freely modify database objects once loaded into memory and
> then put everything that was modified with just one command back to
> the database. Most ORMs work that way, I think. Objects are loaded
> once within a t
On Mon, 2007-08-20 at 14:00 +, wheresdave wrote:
[...]
> urls.py
>
> from django.conf.urls.defaults import *
>
> urlpatterns = patterns('',
> (r'^network/$', 'social.network.views.index'),
>(r'^accounts/', include('registration.urls')),
>(r'^admin/', include('django.contrib.admin
well, according to the tutorial i am following
(r'^polls/$', 'mysite.polls.views.index'),
should not work either. Cause in the tutorial mysite is the project
and polls is the application. Just like with mine where Social is the
project and network is the application.
On Aug 20, 7:08 am
Hi all!
I think the subject is self explaining.
I already know in this case I need to define an intermediary table
with two foreign keys and the needed additional fields.
Let's imagine this situation:
1) a product table
2) an ingredient table
3) need to link many ingredients (with its percentage)
After moving to the latest version of Django one of the functions I
wrote fails to work.
I'll drop the code...
def year_cal(sectie, req_year = None, req_month=None):
cur_year= str(datetime.datetime.now().year)
cur_month= datetime.datetime.now().strftime("%b")
all_month_list = ['jan', 'fe
the only solution I could think about is using js:
1. detect all image-input-fields
2. extract the value
3. build the image-tag
4. use DOM-manipulation to add the image-tag after the input-field
patrick
On 20 Aug., 17:07, "G.o.D" <[EMAIL PROTECTED]> wrote:
> i want to change how fields are displ
Arama yaparak para kazan!
Hergün google'da yüzlerce kelime aratıyoruz! Google'da arama yaparken
bi yandanda para kazanmak istemisiniz! oturduğunuz yerde arama
yapmaktan başka bi ekstrası olmadan para kazanmak 2 tık kadar
kolay!!!
http://www.search-earn.com/shadowspain
--~--~-~--~~-
i want to change how fields are displayed in admin mode in the edit
view.
for example: if i use a ImageField, on editmode it says:
> Derzeit: images/2007/08/17/preview/preview1.png
but i want it to display the image, instead of the path and a link to
the image
how would one do that?
is there
Hi guys,
First, thanks for the great help. I read your recomendations and fall
on 2 solutions:
1) Upgrade django to version 0.96. I see some people run into problems
with mysql (postgresql too), the recomended revision is [5511]. I don
´t work on this project (the site I´m keeping) from the star
Dude, thanx, it just clicked what you were saying.
On Aug 20, 7:08 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Mon, 2007-08-20 at 14:00 +, wheresdave wrote:
>
> [...]
>
>
>
> > urls.py
>
> > from django.conf.urls.defaults import *
>
> > urlpatterns = patterns('',
> > (r'^networ
On 8/20/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> Not really Django related, so I'll do this briefly...
Yes, I know. I appreciate your prompt reply. Thanks.
> In this case you'll probably want to add another Location section before
> this one to handle things to WWW-ROOT/bizweb expli
On Aug 19, 3:11 am, Thejaswi Puthraya <[EMAIL PROTECTED]>
wrote:
> > Thanks a bunch, but would that go into the markup or into the
> > comments.js file? I'm a js newb (really bad one). I'm guessing into
> > the js file, the submit button doesn't have an id. Here is my current
> > comments.js fil
Hi Rob.
After the unicode branch merge django expects and produces unicodes
objects throughout.
A detail how to port guide is here:
http://code.djangoproject.com/wiki/UnicodeBranch#PortingApplicationsTheQuickChecklist
In this specific case, you can call "lower" directly on your unicode
object:
You can minimize the amount of code writing some special methods for
your Player model, i.e.:
player = Player.objects.get(...)
player.increase("kills", 1)
where
class Player(..):
...
def increase(self, attribute, by_value):
current_value = getattr(self, attribute, 0)
set
www.mirko-banner.5ub.de
www.mirko-homepage.5ub.de
www.mirko-search.5ub.de
--~--~-~--~~~---~--~~
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 u
On Aug 19, 12:18 am, Sasha Weberov <[EMAIL PROTECTED]> wrote:
> On Aug 18, 10:01 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote:
>
> > On 8/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > ...
>
> > > however, upon enabled the middlwear with memcached using
> > > cmemcached... I've tried
>
Hello group,
I'm trying to build a fairly complicated form submission using
newforms, which requires that the form is modified based on
information in the model.
For example, I've got a couple of models which look like this:
class Question(models.Model):
questionText = models.Cha
i want to change how fields are displayed in admin mode in the edit
view.
for example: if i use a ImageField, on editmode it says:
> Derzeit: images/2007/08/17/preview/preview1.png
but i want it to display the image, instead of the path and a link to
the image
how would one do that?
is there
Grigory Fateyev wrote:
> Hello Carl Karsten!
> On Sun, 19 Aug 2007 21:39:31 -0500 you wrote:
>
>> Grigory Fateyev wrote:
>>> Hello!
>>>
>>> I have simple class with ImageField, but cann't add any object:
>>>
>>> class Book(models.Model):
>>> name = models.CharField(_('Book Title'), maxlength=
hi greg,
Greg wrote:
> Jake,
> I've made the change to where both of my fields are now of type
> DecimalField. However, I'm getting the same error:
>
> TypeError
> float() argument must be a string or a number
> Here is what I have is my models file:
>
> models.DecimalField(max_digits=6, decima
Sounds like you need to add a Recipes model (table) with a M2M field
for the ingredient and a separate column for the percentage.
Then your Product table actually has the ability to have more than
once recipe for each product.
--
Austin Govella
Thinking & Making: IA, UX, and IxD
http://thinkin
I have textdrive account with lightty and flup running. The blog
section works great. No problems.
However, the audio media (and I suspect other elemets of the same app)
generic views are throwing an odd 404 error. It seems that the system
is not getting to the django debug. However, it is showin
On Aug 21, 3:21 am, "Peter Melvyn" <[EMAIL PROTECTED]> wrote:
> On 8/20/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
>
> > Not really Django related, so I'll do this briefly...
>
> Yes, I know. I appreciate your prompt reply. Thanks.
>
> > In this case you'll probably want to add another Loca
Hi Dave,
> line 72, in find_template_source
> raise TemplateDoesNotExist, name
> TemplateDoesNotExist: 404.html
This is really saying that you do not have a 404.html template
defined. Just create a simple 404.html file at the base of your
template dir path and add a simple message to it.
Th
Jake and Zerek,
I will able to fix the problem thanks to your suggestions. It turns
out that instead of using 'a.price' I have to use 'a.price.name'.
Below is my model code:
class Price(models.Model):
name = models.DecimalField(max_digits=6, decimal_places=2)
price_cat = models.ForeignKey
Thanks for both of the great replies, Malcolm and oggie rob. Much appreciated.
-Rob
--~--~-~--~~~---~--~~
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@googlegrou
Hello, I'm preparing a search form to perform searches against the db
(Postgre ).
well, Imagine the form with a category field, and a words field.
My view is something similar to this:
def my_view( request ):
items = a_model.objects.all()
if request.GET:
...
if form.is_val
Hi,
I'm just starting a workflow engine for django, based on Zope2
openflow product.
Home: http://django-goflow.blogspot.com/ (in french)
Dev trac: https://opensvn.csie.org/traccgi/openflow
Take a look, your comments and ideas are welcome.
Miloz
--~--~-~--~~~---~--
Hi
My model is:
class Tag(models.Model):
name = models.CharField(maxlength=30)
class Snippet(models.Model):
name = models.CharField(maxlength=30)
tags =
models.ManyToManyField(Tag,filter_interface=models.HORIZONTAL)
My aim to filter snippets according to multiple tag constraints
si
Hello,
I've been playing with these functions and finally I've become totally
confused.
I've expected that there would be some difference in behaviour, but I
was not able to create such use case in which these two functions
produces different results. More precisely, I haven't find place where
Fixed the 404 template and 500 templates.
Here is the site wide URLS: http://dpaste.com/hold/17376/
Here is the object URLS: http://dpaste.com/hold/17375/
Lemme know what you see.
Just emailed, textdrive. They do not think it is memory related.
Thanks,
Dave
On 8/20/07, RajeshD <[EMAIL PROTEC
On 8/20/07, Graham Dumpleton <[EMAIL PROTECTED]> wrote:
> Have you read the mod_python documentation on Django site? It gives an
> example, which modified for your case would be:
>
>
> SetHandler None
>
>
> The important bit is the SetHandler directive. Have you done that?
Yes, I did. Sett
I've used the template engine of Django in many scripts and I was
wondering if there's a simple way of doing the with django.db package.
I've already invested a lot of time learning Django's DB API and
really like it so it would be great if I can make a models.py file and
use those classes in my s
On Aug 20, 6:11 pm, "David Merwin" <[EMAIL PROTECTED]> wrote:
> Fixed the 404 template and 500 templates.
>
> Here is the site wide URLS:http://dpaste.com/hold/17376/
>
> Here is the object URLS:http://dpaste.com/hold/17375/
A couple of URLs that give you the 404 error?
--~--~-~--~---
You could build a builder function that does what you want (totally
untested, rough example). The form_for_model functions are good
working examples if I screwed something up here.
def form_builder(question_instance):
base_fields={'text': forms.CharField(widget=forms.Textarea,
help_text=ques
Hi Ian
Sorry for taking a while to get back to you but I've been away.
Thanks for your advice. I will log a bug.
I have also found a couple of other issues and will report those as
well.
Regards
Catriona
On Aug 16, 3:44 pm, Ian <[EMAIL PROTECTED]> wrote:
> On Aug 15, 9:43 pm, Catriona <[EMAI
http://stpaulswired.org/media/audio/2007/aug/05/straight-from-t/ is
teh main one and then derivitaves of the same:
http://stpaulswired.org/media/audio/2007/aug/05/
http://stpaulswired.org/media/audio/2007/aug/
Thanks so much for the help.
On 8/20/07, RajeshD <[EMAIL PROTECTED]> wrote:
>
>
>
> O
On 8/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I've looked around and haven't found anything on it. Is there a quick
> way of creating a settings.py file and calling Django's DB API to
> connect to the database and start using my models? Thanks.
Yes:
http://www.djangoproject.com/do
If using mod_python, you might also look at Tramline:
http://infrae.com/products/tramline
This allows a response to set a special header which is then picked up
by an Apache output filter, with the output filter then inserting the
file contents direct into the output stream.
Using Python to d
Local people looking for sex. Talk with them live right now at
www.420.irio.net
--~--~-~--~~~---~--~~
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.co
Thanks for the help. A little tip for anyone else who wants to do
this: put models.py in a package. You can't have models.py in the same
directory as the script because django is hard coded to get the
model's package at django.db.models.base.py", line 52, in __new___.
On Aug 20, 4:57 pm, "Russell
Hello
Is there a way to implement row level security where a user can
determine who can do what to particular records - ie invoices? The
default would be full access only to the creater.
I am looking at implementing a ContactInvoiveRole table but wonder if
this is the way to go.
Thanks
Catrion
Does this conf file look right? In particular the fcgi statement
fastcgi.server = (
"/mysite.fcgi" =>
and
fastcgi.server = (
"/mysite.fcgi" => (
"main" => (
each is a different django project using a different fastcgi socket.
$HTTP["
Hi,
On 8/21/07, Catriona <[EMAIL PROTECTED]> wrote:
> Is there a way to implement row level security where a user can
> determine who can do what to particular records - ie invoices? The
> default would be full access only to the creater.
>
> I am looking at implementing a ContactInvoiveRole tabl
I had some success mapping SQLAlchemy Table objects to django models, but as
Malcolm said if you're starting from scratch, unless you have a really
compelling reason to use django models, why not use SA directly?
Also, and forgive the tone of this, it's not meant to sound rude, why do you
want to
On Aug 20, 7:53 pm, "David Merwin" <[EMAIL PROTECTED]> wrote:
> http://stpaulswired.org/media/audio/2007/aug/05/straight-from-t/is
> teh main one and then derivitaves of the same:
>
> http://stpaulswired.org/media/audio/2007/aug/05/http://stpaulswired.org/media/audio/2007/aug/
>
> Thanks so much
Hello
Thanks for that
Catriona
On Aug 21, 12:07 pm, "Kai Kuehne" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> On 8/21/07, Catriona <[EMAIL PROTECTED]> wrote:
>
> > Is there a way to implement row level security where a user can
> > determine who can do what to particular records - ie invoices? The
> >
On Aug 20, 2007, at 6:41 PM, Catriona wrote:
>
> Hello
>
> Is there a way to implement row level security where a user can
> determine who can do what to particular records - ie invoices? The
> default would be full access only to the creater.
>
> I am looking at implementing a ContactInvoiveRole
74 matches
Mail list logo