Hey Guys,
I have 4 models working something like this:
class User(models.Model):
name = models.CharField()
email = models.EmailField()
...
class A(models.Model):
domainname = models.CharField()
class B(models.Model):
domain = models.ForigenKey(A)
name = models.CharField()
cl
Im trying to learn django and I appear to be running into an issue
with python manage.py dbshell I am getting the following error can
anyone shed some light on this for me, Im at a loss
Im running MAC OSX 10.5.2 Leopard
I have installed the MySQLdb
Thank You
$ python manage.py dbshell
Tracebac
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. Chec
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 wa
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 exp
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 ha
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 Pos
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 inf
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 "Powe
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:
> form.save
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 blo
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/
O
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 thi
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 s
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 'T
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 reques
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 ar
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):
>ret
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 th
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 a
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 WO
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 t
> 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 referenced
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 p
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 I
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 regula
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
> > offer
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 Dja
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 t
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 messag
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: http:
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 a
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 = models.CharField(m
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__ in
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:
>
> o
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 2
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 nu
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,
> null=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 = forms.DateTi
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
smtp_us
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 *
>
> url
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 post:http:
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 grou
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 gi
54 matches
Mail list logo