We ran into a problem where users would either a) not be in SSL mode
when they should be, or b) be *in* SSL mode when they shouldn't be. We
solved it with middleware to make sure that we were always in the
correct mode. Note: the page you are on when filling out a form does
not, technically, have
On Sun, 2008-04-20 at 20:16 -0400, Michael wrote:
> your days and months can be one your two digits. So:
> (r'^(?P\d{4})/(?P
> \d{1,2})/(?P\d{1,2})/(?P[a-z0-9-]
> +)/$',
>
> You can always open up a shell and see the error that is not showing
> up in your template. Use the reverse function.
On Sun, 2008-04-20 at 16:05 -0700, meppum wrote:
> I think I figured out what it is. After finding the post below which
> referenced ticket #3951 it seems it's a known issue.
>
> The last time the ticket was updated was June of 2007. Am I to
> understand this is not going to be fixed?
If it
I believe this is a postgres thing -- the transaction failed but
postgres didn't rollback, and the message_set.create tries to put a
message in the database. it's kind of ghetto, but you can also try
manually rolling back postgres when you catch the exception but before
you set the message.
As far as I understand it, you need to put the code from the snippet
in its own file and either put that in your project's directory or
somewhere in your python path. Then you have to add the class to
settings.py (there are some existing middlewares, just see how they do
it).
I don't have any
On 21-Apr-08, at 6:42 AM, radioflyer wrote:
> I've decided to manually check for uniqueness after form validation
> and before saving, and that seems to work fine for now.
>
> Things like 'unique_for_date' and 'unique_together' seem to work great
> in the admin interface, but in the wild, you
Hello Kenneth,
Yes it would. If the user tries to submit a Change that is not unique
on 'student' and 'date' , I want to return them back to the original
page with a message that says "You've already got a change submitted
for that date."
I'm guessing that the programming error has to do with
Hello,
I have a page on my site where customers can place their order. This
page is secure (https://). I'm finding that whenever some users click
click submit they are presented with a message saying:
//
Security alert you are about to be redirected to a connection that is
not secure.
The
On 21-Apr-08, at 3:05 AM, Greg Lindstrom wrote:
> I'll be happy to post some code, but I'd like some direction on how
> to set up a page. I would like a header and sidebar. The footer
> is optional, but I think it gives a nice, finished look to the page
> (and it's where I have the
On 21-Apr-08, at 12:50 AM, radioflyer wrote:
>
> Hello,
> I need some help with the code after the IntegrityError exception.
>
>
> s = Student.objects.get(pk=student_id)
>
> if request.method == 'POST':
> form = ChangeForm(request.POST)
> if form.is_valid():
> try:
>
Hey Greg;
It's good to see you having fun with setting up your first web app. Laying
out in Django is really great because it let's you work with style and
markup however you like. I generally layout the entire site in HTML and CSS
before I even start working with the django application.
Your
your days and months can be one your two digits. So:
(r'^(?P\d{4})/(?P\d{1,2})/(?P\d{1,2})/(?P[a-z0-9-]
+)/$',
You can always open up a shell and see the error that is not showing up in
your template. Use the reverse function. Check out:
http://www.b-list.org/weblog/2007/sep/06/tips-and-tricks/
J. Pablo Fernández escribió:
> No ideas on this?
Hi!
By default they are wrapped in ERROR
MESSAGE.
Juanjo
--
mi blog: http://www.juanjoconti.com.ar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
No ideas on this?
On Apr 6, 2:38 am, J. Pablo Fernández <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Is there some way to add a class="error" or wrap the inputs in a class="error"> when the field has a validationerror?
>
> Thanks.
--~--~-~--~~~---~--~~
You received
Hello Everyone-
I to the point of putting together my first Django web app (heck, my first
real web app). It's for a gym where my daughter takes gymnastics (level 7,
thank-you). This one is mostly static content, but I have created a few
tables and it's getting me a feel for putting together a
Its been a while, but I had problems getting this to work at first
too. It turned out to be how I was importing the module that
contained thread locals. I needed to specify the project as well as
the app when doing the import.
I couldn't just do from myapp import mymiddleware, I had to do from
Hello,
I have a model in models.py as shown below:
class Tutor(models.Model):
first_name = models.CharField(maxlength=40)
last_name = models.CharField(maxlength=40, core=True)
etc...
etc...
It simply captures fname and lname and adds it to my database. It
works.
However, the
Hello,
I need some help with the code after the IntegrityError exception.
s = Student.objects.get(pk=student_id)
if request.method == 'POST':
form = ChangeForm(request.POST)
if form.is_valid():
try:
form.save()
request.user.message_set.create(message="Your
Thank you, I had various as errors as you pointed out and as soon as I
implemented your suggestions and reset the database it all works now.
On Apr 20, 8:43 am, Peter Rowell <[EMAIL PROTECTED]> wrote:
> > featured_place = models.ForeignKey(Place, null=true, blank=true)
>
> 1. By any chance
Whoops, sorry, that was bad advice, please ignore!
On Apr 20, 2008, at 5:19 AM, Matt wrote:
>
> I'm trying to get the following get_absolute_url function working in
> one of my models:
>
>
>def get_absolute_url(self):
>
Hi,
I had the same problem earlier - 0.96 on Leopard. How do you switch to
trunk?
Thanks,
Ed
On Apr 20, 4:53 pm, sinker <[EMAIL PROTECTED]> wrote:
> Switching to trunk WORKED. Thank you so much!
>
> On Apr 19, 7:42 am, Polat Tuzla <[EMAIL PROTECTED]> wrote:
>
> > I got the same problem with
Just as in table Test:
name url sizetime
a a1 a2 a3
b b1 b2 b3
When i get "a" ,how i can get other attrs about a1,a2,a3 while querying?
Thanks a lot :D
--
deSign thE fuTure
http://www.freeis.cn/
On Apr 20, 1:32 am, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Apr 20, 3:54 pm, Lee Hinde <[EMAIL PROTECTED]> wrote:
>
> > This is more venting than anything.
>
> > As a long-time Mac fan boy I'm hugely disappointed at how much trouble
> > it's been to get Apache/MySQL/Mod_Pythyon/django
Check that the localizations got installed when you installed .96.
This was a problem I had... the installer didn't install the admin
templates or any of the localization files and I had to copy them in
manually.
Jon.
On Apr 20, 10:53 am, sinker <[EMAIL PROTECTED]> wrote:
> Switching to trunk
Switching to trunk WORKED. Thank you so much!
On Apr 19, 7:42 am, Polat Tuzla <[EMAIL PROTECTED]> wrote:
> I got the same problem with the version 96.1 on Mac.
> Then switched to trunk and everything went OK.
> Unfortunately can't tell you why this happened, as I did not bother to
> investigate
> featured_place = models.ForeignKey(Place, null=true, blank=true)
1. By any chance are you getting an error like "NameError: name 'true'
is not defined"? The python keyword is "True", not "true".
2. If you reference a mode before it is defined, you need to supply a
string for the
sinker escribió:
> I checked it out on every browser I have installed on my machine
> (incl. Firefox) ... no calendar on any of them. I'll try switching to
> trunk.
>
I had no this problem in 0.96 running firefox on Ubuntu.
Juanjo
--
mi blog: http://www.juanjoconti.com.ar
I checked it out on every browser I have installed on my machine
(incl. Firefox) ... no calendar on any of them. I'll try switching to
trunk.
Thanks to everyone!
On Apr 19, 10:39 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I believe this was a Safari issue that was fixed at some point
Hi all,
I'm working on an application where a user has an a special number
assigned to them. This account number must be editable both by the
user and in admin. I want the number to be obfuscated in the form
when it is initially displayed but then when overwritten by a customer
service rep (in
Hi All,
I've followed the CookBook (http://code.djangoproject.com/wiki/
CookBookThreadlocalsAndUser) to have the user available in my model. I
have added the ThreadLocals class to my code and added it to the
middleware class setting. It gets called en sets values that look
valid.
However, when
Matt,
You're using get_absolute_url to return an actual view – it's only
meant to return a string representing the the URL for that model
instance. The generic view information goes in your URL config file
only, and get_absolute_url should return a URL that is matched by one
of the
Yes - sorry. In the admin. Thanks. Ed
On Apr 20, 1:59 pm, Juanjo Conti <[EMAIL PROTECTED]> wrote:
> chiefmoamba escribió:
>
> > Hi All,
>
> > For some reason my DateTimeField is not showing a calendar next to the
> > 'DateTime' box in my view. My code from models.py is below. Can anyone
> >
Thanks, Phil! That works perfectly.
The only thing that feels awkward about Django's models is that the
attributes feel like a mixture of stuff that belongs to the view and
stuff that belongs to the model (blank=True, null=True anybody?). But
that's about the only small complaint I have about
I defined such a model:
class Thing(models.Model):
photo = models.ImageField(
upload_to='images/', blank=True, null=True)
Here is the form for this model:
class ThingForm(ModelForm):
class Meta:
model = Thing
Now it could handle the image upload request and save images
Berco Beute escribió:
> Using: Latest from trunk
>
> I'm using a custom widget for datetimefields:
>
BTW, which one are you using? The one that wrappers jscalendar?
Juanjo
--
mi blog: http://www.juanjoconti.com.ar
--~--~-~--~~~---~--~~
You received this
chiefmoamba escribió:
> Hi All,
>
> For some reason my DateTimeField is not showing a calendar next to the
> 'DateTime' box in my view. My code from models.py is below. Can anyone
> offer me any suggestions? I am using 0.96.
You mean in the admin or in any other place?
Juanjo
--
mi blog:
Ok, I see. After some mucking around, I managed to make it work like
this:
orgs = Organisation.objects.filter(blabla=something)
values = orgs.values('country')
country_id_list = [value['country'] for value in values]
num_countries = Country.objects.filter(id__in=country_id_list).count()
Looks
I'm trying to get the following get_absolute_url function working in
one of my models:
def get_absolute_url(self):
return ('django.views.generic.date_based.object_detail', (), {
'year': self.start_date.year,
Hi All,
For some reason my DateTimeField is not showing a calendar next to the
'DateTime' box in my view. My code from models.py is below. Can anyone
offer me any suggestions? I am using 0.96.
Thanks,
Ed
from django.db import models
class Course(models.Model):
course =
On Sun, 2008-04-20 at 03:49 -0700, Alex Koshelev wrote:
> No, in python each module evaluates one time - at import process.
Your answer depends upon the condition that things are only imported
once, which isn't true if __import__() is used (it acts like reload()).
Since Django uses __import__
On Sun, 2008-04-20 at 03:32 -0700, Julien wrote:
> Hi,
>
> Here's my code:
>
> class Country(models.Model):
>
>
> class Organisation(models.Model):
> country = models.ForeignKey(Country, db_index=True)
>
>
>
> Then, in a views, I select a number of organisations:
>
>
No, in python each module evaluates one time - at import process.
On Feb 29, 12:18 am, itodd <[EMAIL PROTECTED]> wrote:
> Ok,
>
> I've figured out models.py was being evaluated multiple times. Where
> should I put my dispatcher code to ensure this doesn't happen?
>
> Thanks,
>
> Todd
>
> On Feb
On Apr 20, 3:51 am, yish <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am having a problem with Apache (prefork),mod_python, Django (trunk-
> version 6410) and python 2.5.1. I am currently testing my site with 5
> apache processes and haven't yet set up memcached (on the list but had
> some issue with
Hi,
Here's my code:
class Country(models.Model):
class Organisation(models.Model):
country = models.ForeignKey(Country, db_index=True)
Then, in a views, I select a number of organisations:
orgs = Organisation.objects.filter(blabla=something)
Now, I'd like to get the
On 20/04/2008, Berco Beute <[EMAIL PROTECTED]> wrote:
>
> Using: Latest from trunk
>
> I'm using a custom widget for datetimefields:
>
> ==
> #models.py
> class Event(models.Model):
> endDateTime = models.DateTimeField('Finish', blank=True,
>
On Sun, 2008-04-20 at 02:20 -0700, Berco Beute wrote:
> Using: Latest from trunk
>
> I'm using a custom widget for datetimefields:
>
> ==
> #models.py
> class Event(models.Model):
> endDateTime = models.DateTimeField('Finish', blank=True,
> null=True)
>
Using: Latest from trunk
I'm using a custom widget for datetimefields:
==
#models.py
class Event(models.Model):
endDateTime = models.DateTimeField('Finish', blank=True,
null=True)
#forms.py
class EventForm(forms.ModelForm):
endDateTime =
Thanks Malcolm, I opted for the Django solution and it worked indeed.
Here's the new code:
from django.conf import settings
from django.core.mail import EmailMultiAlternatives, SMTPConnection
smtp_server='XXX' # Only because I want to use different
settings than the default ones
I think you can write it like
(r‘^([\w-]+)/(\d{4})/(\d+)/(\d+)/(?P\d+)/$’,
find_seminar_occurrence),
it should be OK.
On 4月20日, 上午10时31分, Brandon Taylor <[EMAIL PROTECTED]> wrote:
> Changing my urls.py to this:
>
> from django.conf.urls.defaults import *
> from rdk.training.views import *
>
>
On Apr 20, 3:54 pm, Lee Hinde <[EMAIL PROTECTED]> wrote:
> This is more venting than anything.
>
> As a long-time Mac fan boy I'm hugely disappointed at how much trouble
> it's been to get Apache/MySQL/Mod_Pythyon/django all working together
> on an Intel Mac running Leopard.
>
> This
Is psyco active and alive? Is it compatible with django? What about
Pypy? Anyone using any of these jit engines to run Django?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
I had worked out my way.
The hyperlink for a specifc object in admin interface is actually
hardcoded in contrib.admin.views.main.py, line 766:
def url_for_result(self, result):
return "%s/" % quote(getattr(result, self.pk_attname))
so what I did, is to overwrite this method of the
On 20-Apr-08, at 12:16 PM, James Bennett wrote:
> On Sun, Apr 20, 2008 at 1:33 AM, lee <[EMAIL PROTECTED]> wrote:
>> designers. Do the designers use text base editting like ultraedit or
>> or graphics based software like dreamweaver? Most of the artist I
>> know
>> don't do much coding and
On Sun, Apr 20, 2008 at 1:33 AM, lee <[EMAIL PROTECTED]> wrote:
> designers. Do the designers use text base editting like ultraedit or
> or graphics based software like dreamweaver? Most of the artist I know
> don't do much coding and are into photoshop, illustrator and
> dreamweaver.
Most
On 20-Apr-08, at 12:03 PM, lee wrote:
> Do the designers use text base editting like ultraedit or
> or graphics based software like dreamweaver? Most of the artist I know
> don't do much coding and are into photoshop, illustrator and
> dreamweaver. On sites like lawrence.com where there are
I am new to django, but I think it is really cool. I have used other
web dev systems before like zope/plone and php. I am a little new to
the template type system of django and I was wondering how most web
designer create therir content when there are seperate programmers and
designers. Do the
56 matches
Mail list logo