paste your form code please
On Sun, Apr 15, 2012 at 11:54 PM, Andy McKay wrote:
> What does your form code look like?
>
> --
> 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.
>
Generally, I just use syntax highlighting in my text editor: that usually
helps me find errors.
TextMate has a nice HTML (Django Template) mode.
Matt.
On Monday, April 16, 2012 2:12:14 AM UTC+9:30, Marcin wrote:
>
> Hi all,
>
> I've got a template that isn't parsing, but the error is the
> no
you can check the form data dictionary by:
if form.is_valid():
print form.__dict__
--
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 emai
Hi,
Gchorn schrieb (16.04.2012 07:24 Uhr):
Hello, I'm trying to create a blog site using Django (with "Post" as
my main model and "text" as the attribute corresponding to the main
body of text for each post). On the admin page, when someone is
filling out fields to create a new blog post, I wan
On Sat, Apr 14, 2012 at 9:27 PM, Swaroop Shankar V wrote:
> Hi All,
>
> Am using flatpage app in my application. I want to send
> few additional variables that can be accessible from the flatpage templates.
> So how can i accomplish the same?
>
You cannot. The only way to get additional variables
I appreciate your reply, but you haven't quite helped me out.
If I do the filtering in views.py, I the template would have to make
assumptions about the type of context variables I will be passing it.
Or am I seeing this the wrong way?
On 15 April 2012 00:41, dummyman dummyman wrote:
> do the
You can use templatetags for example:
https://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs
On Saturday, April 14, 2012 10:51:51 AM UTC+2, Nikhil Somaru wrote:
>
> Greetings,
>
>
> I would like to do something like queryset filtering in a template. Is the
> only solution via
Hi,
I have a problem whenever I create a new project using the start project
command, no manage.py file is created.
I'm using Mac OS X. Thank you in advance
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to d
Hi Marc,
Thanks for your reply. Are you referring to the "max_length" element of my
"text" CharField? If so, I don't think this is the issue; I've set the max
length to 10,000 characters which is quite long. Also this setting does
not change the size of the text input area relative to my other
Wing IDE also highlights templates.
On Apr 16, 2012 3:16 AM, "Matt Schinckel" wrote:
> Generally, I just use syntax highlighting in my text editor: that usually
> helps me find errors.
>
> TextMate has a nice HTML (Django Template) mode.
>
> Matt.
>
>
> On Monday, April 16, 2012 2:12:14 AM UTC+9:
On Mon, Apr 16, 2012 at 6:00 AM, Nikhil Somaru wrote:
> If I do the filtering in views.py, I the template would have to make
> assumptions about the type of context variables I will be passing it.
>
> Or am I seeing this the wrong way?
i think so. the view is where you manage _what_ is shown, t
I've got a model in django 1.4:
class Image(Model):
serial = AutoField(primary_key=True)
version = IntegerField(default=1)
I want (serial, version) to be unique. Is there a way to express that in the
model layer?
---
Roy Smith
r...@panix.com
--
You received this message because you a
On Mon, Apr 16, 2012 at 9:24 AM, Roy Smith wrote:
> I want (serial, version) to be unique.
class Meta
unique_together = [('serial','version')]
--
Javier
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
On Monday, 16 April 2012 06:24:54 UTC+1, Gchorn wrote:
>
> Hello, I'm trying to create a blog site using Django (with "Post" as
> my main model and "text" as the attribute corresponding to the main
> body of text for each post). On the admin page, when someone is
> filling out fields to create
I understand serial by nature is unique.
On Mon, Apr 16, 2012 at 9:24 AM, Roy Smith wrote:
> I've got a model in django 1.4:
>
> class Image(Model):
>serial = AutoField(primary_key=True)
>version = IntegerField(default=1)
>
> I want (serial, version) to be unique. Is there a way to expr
Hi Djangoers,
I have an issue I can't work out. This is the situation:
I have a model called payment, which has a custom constructor which takes a
parameter. This is the code:
class Payment(models.Model):
id = models.AutoField(primary_key=True)
amount = models.FloatField("Total payment a
Would this help?
http://stackoverflow.com/questions/3086637/how-should-i-validate-html-in-django-templates-during-the-development-process
I quite like the not-accepted-as-answer. Just go through your urls.
Essentially, you have two types of possible template errors:
1. human errors (missing a cl
PyCharm does a very good job here when it comes to highlighting and error
detection in templates. Try it out.
On 17 April 2012 01:12, John Yeukhon Wong wrote:
> Would this help?
>
> http://stackoverflow.com/questions/3086637/how-should-i-validate-html-in-django-templates-during-the-development-p
I need an integer field which generates increasing integers. But I don't want
it to be my primary key. In fact, it can't be, because I want the ability to
manually reset it to something else. The auto-increment is just a default
value.
If I do:
> class Image(Model):
> serial = AutoField
Thanks. Neither of those would help with my problem, which is that django
itself was refusing to parse my template.
My solution was to simply comment out regions, and re-instate them until
the error was once again detected.
On Mon, Apr 16, 2012 at 16:12, John Yeukhon Wong wrote:
> Would this hel
Auto-incrementing fields are meant to be primary keys that is their
purpose. I have never tried it but a formula in the default value for an
integer field to increment it might work
On Mon, Apr 16, 2012 at 10:17 AM, Roy Smith wrote:
> I need an integer field which generates increasing integers.
I came up against this also. My work-around was to create a model that
exists explicitly for the purpose of generating sequential integers (I also
need them to be unique, so it's acceptable for my purposes). You might like
to have two fields to accomplish the same thing with duplicates (which I
adm
On Mon, Apr 16, 2012 at 10:11 AM, Mario Gudelj wrote:
> I think I need to somehow pass the business object to model = Payment inside
> the Meta class...
how many 'business' options are there?
if it's a fixed num, you could add a Proxy 'subclass' for each one
that simply provides the apropriate p
On Mon, Apr 16, 2012 at 4:11 PM, Mario Gudelj wrote:
> Hi Djangoers,
>
> I have an issue I can't work out. This is the situation:
>
> I have a model called payment, which has a custom constructor which takes a
> parameter. This is the code:
>
> class Payment(models.Model):
> id = models.AutoFi
Shoot! I was thinking that might be the case originally, but I must have
overlooked TextField in the model field docs. Thanks!!!
I'm still curious though--how can I find out what all of the CSS classes are
that are defined by the default admin style sheet (I guess I'm asking where
this style sh
INVITATION_CODE = "You should have received one of these."
PAR_EMAIL_ADD = "Will be used for all communications."
PASSWORD= ""
STUD_FIRST_NAME = "Enter what the student prefers to go by."
STUD_LAST_NAME = ""
COURSE_1= "Select the course enrolled in and/or getting
tutoring in."
CO
Hey Javier,
Thanks for the reply. There are thousands of different businesses, so I
guess I'll have to go with the last option...
Is this kind of what you're referring to there
http://stackoverflow.com/questions/7114710/using-a-mixin-with-a-django-form-class
?
Thanks again.
-m
On 17 April 2012
On Mon, Apr 16, 2012 at 4:39 PM, Chris Seberino wrote:
> def clean_username(self):
>
> """
> custom validation
> code
> """
>
> if "username" in self.cleaned_data:
> username = self.cleaned_data["username"]
>
On 2012-04-16, at 17:17 , Roy Smith wrote:
>> AssertionError: AutoFields must have primary_key=True.
>
> Is this a bug?
Unlikely considering the assertion was specifically added to AutoField as part
of a commit noting:
> Refactored the way save() works so that non-integer primary keys are
> no
Hi Tom,
Thanks for chiming in, mate.
What I'm doing here is I'm getting the subdomain from the request and
matching it to the business when paypal PDT notification gets posted with
GET to my app.
I then need to save the payment info and sine a foreign key for the payment
is business I need to sa
On Mon, Apr 16, 2012 at 4:50 PM, Mario Gudelj wrote:
> Hi Tom,
>
> Thanks for chiming in, mate.
>
> What I'm doing here is I'm getting the subdomain from the request and
> matching it to the business when paypal PDT notification gets posted with
> GET to my app.
>
> I then need to save the payment
I'm doing something like this to generate some models dynamically:
SIMILAR_MODELS_TEMPLATE=
> """
> @some_decorator
> class %(PREFIX)sModel (Some_Abs_model):
> \"""%(DESCRIPTION)s
> \"""
> pass
> """
then I have a factory:
> def similar_models_factory(prefix,description):
> for
Did you know that you can use the type function to dynamiclly generate a
class definition?
See http://docs.python.org/library/functions.html?highlight=type#type
From the example:
class X(object):
... a = 1
Is exactly the same as doing...
X = type('X', (object,), dict(a=1))
Check https://github.com/JeffHeard/ga_dynamic_models. It may be similar to
what you're looking for. Even if you don't want the code, you can see a
way of dynamically generating models.
On Mon, Apr 16, 2012 at 12:40 PM, Philip Mountifield <
pmountifi...@formac.net> wrote:
> Did you know that yo
Hummm, I see, thanks for that, I didn't know about type.
And is there a way to generate functions too?(I was also doing it using
exec).
And do you have any idea of how can I see the difference in performance
when using one or the other?
Thanks.
Em segunda-feira, 16 de abril de 2012 13h45min58s
On Mon, Apr 16, 2012 at 11:08 AM, Tom Evans wrote:
> Surely you would want what business a payment relates to to be stored
> directly in the database?! At which point it simply becomes an
> additional field in your payment model, and the only problems come
> with automatically populating that fiel
hi
could you post
django version
python version
you use virtualenv? if yes what version
and the code you use to generate the project
cheers
El 16/04/2012, a las 13:26, Faeez Abd Rahman escribió:
> Hi,
>
> I have a problem whenever I create a new project using the start project
> command, no m
If you are using Django 1.4 check in the application folder of your
project below your project folder. It should be in there.
Faeez Abd Rahman wrote:
Hi,
I have a problem whenever I create a new project using the start
project command, no manage.py file is created.
I'm using Mac OS X. Thank
after project you need to do start app for making module
T.
On Mon, Apr 16, 2012 at 8:17 PM, Buddy Lindsey, Jr.
wrote:
> If you are using Django 1.4 check in the application folder of your
> project below your project folder. It should be in there.
>
>
> Faeez Abd Rahman wrote:
>
>
> Hi,
>
> I h
Hello, I am using django 1.3 on apache 2.* on windows server 2008.
mysql 5.*
When i try to access a view that does this: def view(request):
len(User.objects.all()) return HttpResponse()
i have about 9K results on that. i am doing len and not .count,
because i want to test the server.
the server
Hello Yarden,
On Monday, April 16, 2012 12:25:36 PM UTC-7, Yarden Sachs wrote:
Hello, I am using django 1.3 on apache 2.* on windows server 2008.
> mysql 5.*
>
> When i try to access a view that does this: def view(request):
> len(User.objects.all()) return HttpResponse()
>
> i have about 9K
using aws ec2 & rds. so rolling out that. i monitor every query for high
performance. but Users all is very simple query.
what do u think it could other than those?
thanks for all the help
On Monday, April 16, 2012 10:59:55 PM UTC+3, creecode wrote:
>
> Hello Yarden,
>
> On Monday, April 16
hi Yarden
how many users have you in your database?
you use mod_fcgi or mod_python? ( more recommendable will be mod_fcgi or
mod_fcgid )
Django is framework that suppert very very large traffic.
you can see an example here
http://instagram-engineering.tumblr.com/post/13649370142/what-powers-inst
i have 9000 rows. and using mod_wsgi on apache2. what am i doing wrong? i
tried to switch to nginx+fcgi. and tried ubuntu srrver as well. same
results.
any ideas?
On 16 באפר 2012 23:18, "andrea mucci" wrote:
> hi Yarden
>
> how many users have you in your database?
> you use mod_fcgi or mod_pyth
On Mon, Apr 16, 2012 at 5:22 PM, Yarden Sachs wrote:
> i have 9000 rows. and using mod_wsgi on apache2. what am i doing wrong? i
> tried to switch to nginx+fcgi. and tried ubuntu srrver as well. same
> results.
>
> any ideas?
Do you have DEBUG=False in your settings?
--
Ramiro Morales
--
You
ofcourse... i am using django since dec 10, and now i dont know what to do
On 16 באפר 2012 23:30, "Ramiro Morales" wrote:
> On Mon, Apr 16, 2012 at 5:22 PM, Yarden Sachs wrote:
> > i have 9000 rows. and using mod_wsgi on apache2. what am i doing wrong?
> i
> > tried to switch to nginx+fcgi. and
have you debugged the mysql query
nginx+fgi work pretty well so is very very strange.
have you tried to test, other type of query result without len method?
El 16/04/2012, a las 22:22, Yarden Sachs escribió:
> i have 9000 rows. and using mod_wsgi on apache2. what am i doing wrong? i
> tried t
On Mon, Apr 16, 2012 at 2:25 PM, Yarden Sachs wrote:
> * COUNTING THE RESULTS IS NOT THE POINT
ok, then that len(User.objects.all()) is not an appropriate benchmark, right?
what you're doing is a view that fetches all 9K records from the DB,
without any filtering. will your views do that? usua
what perpesfully used. for heavy system performance
On 16 באפר 2012 23:38, "andrea mucci" wrote:
> have you debugged the mysql query
>
> nginx+fgi work pretty well so is very very strange.
>
> have you tried to test, other type of query result without len method?
>
>
> El 16/04/2012, a las 22:22,
You're creating a contrived test though. If you really wanted the
count of users you'd probably do a "count" in the database itself.
I don't think you're getting any valuable data on your application's
actual performance: you basically made a view that just loops over
9000 items. Of course it will
Sure,
I experienced unknown performance issues(slow responses) when high traffic
would hit that site.
so, started to test what happens if i hit the web site with a big
calculation, like len function on an 9k objects.
when i try to do it from client, it takes 0.7 secs to come back with
response
On Mon, Apr 16, 2012 at 3:49 PM, Yarden Sachs wrote:
> when i try to do it from client, it takes 0.7 secs to come back with
> response, if try to do it from 10 parralel client, it takes 15 secs for one
> http response!
well, if you do a heavy and memory intensive task, then doing it ten
times is
it took 20 times more for EACH request. that means that if 20 users accross
the web ask for differrent heavy data- instead of taking a second for each
one, every user will wait for 20 seconds before the response will answer.
On 16 באפר 2012 23:54, "Javier Guerra Giraldez" wrote:
> On Mon, Apr 16,
On 04/16/2012 04:49 PM, Yarden Sachs wrote:
Sure,
I experienced unknown performance issues(slow responses) when high
traffic would hit that site.
>
so, started to test what happens if i hit the web site with a big
calculation, like len function on an 9k objects. when i try to do it
from client
thanks! have any advice for good performance? and profiling?
On 17 באפר 2012 00:18, "CLIFFORD ILKAY" wrote:
> On 04/16/2012 04:49 PM, Yarden Sachs wrote:
>
>> Sure,
>>
>> I experienced unknown performance issues(slow responses) when high
>> traffic would hit that site.
>>
> >
>
>> so, started to
TIL don't override model class constructor if you don't really have to.
Thanks for all your help guys! Now when I think about it I don't even know
why I did it in the first place.
On 17 April 2012 03:12, Javier Guerra Giraldez wrote:
> On Mon, Apr 16, 2012 at 11:08 AM, Tom Evans
> wrote:
> > S
OK, thanks for sharing this
On 16 Apr, 07:54, Pavan Verma wrote:
> I am a Django newbie and also interested in this question.
>
> From reading the Django bookhttp://www.djangobook.com/en/2.0/chapter05/,
> I see that the query 'Publisher.objects.order_by('name')[0:2]' maps
> to:
>
> SELECT id, nam
> Field clean methods do not return cleaned_data dict, they return
> specific data from within that dict.
Tom
Thanks so much! That fixed it! For the life of me I can't
understand how my site has been operating
for MONTHS without this bug manifesting itself. I guess my site
didn't have to use
Run django debug toolbar, see what queries you are running and how
long they take and that you've got database indexes set up.
Failing that, run a middleware or other logging tool to tell you slow
pages. Then test with django debug toolbar. Rinse and repeat.
--
You received this message because
Both patterns will produce same query. You can also use
django-debug-toolbar, which gives ur debugsqlshell tool. So you can execute
code from the commandline and can see what the query will be.
Django also has a code pattern for your case - for getting the first
element, you can just use latest
In my app I need a way to associate objects with a specific user. Users
should not have access to other users objects. I'm implementing this in my
model by setting a ForeignKey to the user that owns the object:
owner = models.ForeignKey(User)
Is this a bad idea? Can someone explain under what
I'm not totally sure if this qualifies as a Django question, but it's
impeding my ability to make a website with Django so I thought I'd ask
here. I'm working with Django in Ubuntu 11.10, where I've set up
PostgreSQL to make and manage databases for my Django-powered website.
Unfortunately, w
I am having trouble figuring out how to query the database and return
the results in a format that my template can render appropriately.
I have a model that has a ManyToMany field:
class Student()
...
parents = models.ManyToManyField('parents.Parent', blank=True,
null=True)
...
The
Something more specific in case it helps: as an example, when I try to
access my admin view while logged in as my regular user ("guillaume")
instead of "postgres", I get the following error:
OperationalError at /admin/
FATAL: Peer authentication failed for user "postgres"
Request Method: GET
64 matches
Mail list logo