this ModelForm view to save to the db, what am I doing
wrong please
Cannot seem to get .save() to write to the db
This is the model
class Customer(models.Model):
email = models.EmailField()
postcode = models.CharField(max_length=10)
def __unicode__(self):
return self.email
Cannot seem to get .save() to write to the db
This is the model
class Customer(models.Model):
email = models.EmailField()
postcode = models.CharField(max_length=10)
def __unicode__(self):
return self.email
def save(self):
self.postcode=upper(self.postcode)
On 01/19/12 03:36, Django Newbie wrote:
Example.
url(r'^People/Info/(?P\d+)/$', 'iFriends.People.views.details'),
url(r'^People/Info/(?P[a-z]{3})/$',
'iFriends.People.views.detail_name'),
It works with numeric value. if I use "http://localhost:8000/
People/Info/1/"
but not with if I use
Hi,
I am trying to figure out a way to call a function depending on the
parameter in the URL.
Example.
url(r'^People/Info/(?P\d+)/$', 'iFriends.People.views.details'),
url(r'^People/Info/(?P[a-z]{3})/$',
'iFriends.People.views.detail_name'),
It works with numeric value. if I use
On Tuesday, January 25, 2011 5:41:35 PM UTC, MikeKJ wrote:
>
>
> class CertForm(forms.Form):
> agree = forms.BooleanField(required=True, label="I confirm the above
> and
> agree.")
> cert = forms.BooleanField(required=False, label="I require a
> certificate")
>
> class
rform is invalid in any case
> 3 Just save the data given to another model 'Accounts' is all I want it to
> do but it has to be done in here as this is where the agree is done
> --
> View this message in context:
> http://old.nabble.com/what-am-I-doing-wrong--tp30760259p30760259.html
> S
this message in context:
http://old.nabble.com/what-am-I-doing-wrong--tp30760259p30760259.html
Sent from the django-users mailing list archive at Nabble.com.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, sen
On Fri, Oct 29, 2010 at 6:30 PM, Jumpfroggy wrote:
> Hi all,
>
> I've been working in django for a while now, but am still wrapping my
> head around the more complex queryset features.
>
> I have something like this:
>
> class Foo:
> name = CharField()
> bars =
Hi all,
I've been working in django for a while now, but am still wrapping my
head around the more complex queryset features.
I have something like this:
class Foo:
name = CharField()
bars = ForeignKey(Bar)
widgets = ForeignKey(Widget)
I can do this:
Foo.objects.extra(select={
uot;,
line 497, in _add_items
[self._pk_val] + list(new_ids))
File
"/Users/eric/working/rfapns/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/db/backends/util.py",
line 19, in execute
return self.cursor.execute(sql, params)
ProgrammingError: can't adapt
What am I doing wr
usual problem, which has reared its ugly head on
> several fronts. The basic jist is that Django seems to not recognize
> database changes made...
>
[snip]
>
> What am I doing wrong?
>
You are seeing the same things as described in this thread:
http://groups.google.c
= Source.objects.get(id = 1)
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/share/django/django/db/models/manager.py", line
120, in get
return self.get_query_set().get(*args, **kwargs)
File "/usr/local/share/django/django/db/models/query.p
Thanks...it worked.
-Original Message-
From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com]
On Behalf Of Daniel Roseman
Sent: Monday, October 26, 2009 7:01 PM
To: Django users
Subject: Re: syntax error what am i doing wrong???
On Oct 26, 10:35 pm, "jon...@co
On Oct 26, 10:35 pm, "jon...@cox.net" wrote:
> SyntaxError at /
>
> ('invalid syntax', ('c:\\Users\\Vincent\\Documents\\django_bookmarks\
> \..\\django_bookmarks\\bookmarks\\views.py', 15, 20, 'return Http
> Response(output)\n'))
>
> SCRIPT FROM VIEWS.PY
>
> from django.http
2009/10/26 jon...@cox.net :
>
> SyntaxError at /
>
> ('invalid syntax', ('c:\\Users\\Vincent\\Documents\\django_bookmarks\
> \..\\django_bookmarks\\bookmarks\\views.py', 15, 20, 'return Http
> Response(output)\n'))
>
> SCRIPT FROM VIEWS.PY
>
> from django.http import HttpResponse
SyntaxError at /
('invalid syntax', ('c:\\Users\\Vincent\\Documents\\django_bookmarks\
\..\\django_bookmarks\\bookmarks\\views.py', 15, 20, 'return Http
Response(output)\n'))
SCRIPT FROM VIEWS.PY
from django.http import HttpResponse
def main_page(request) :
output = '''
%s
On Sun, May 17, 2009 at 12:38 PM, ringemup wrote:
>
>
> Aha. I'm on 1.0. Can I still use custom validation on the ModelForm
> if I use the ModelAdmin to exclude the fields?
>
> Thank you!
>
>
> On May 17, 1:36 pm, Alex Gaynor wrote:
> > On Sun, May
Aha. I'm on 1.0. Can I still use custom validation on the ModelForm
if I use the ModelAdmin to exclude the fields?
Thank you!
On May 17, 1:36 pm, Alex Gaynor wrote:
> On Sun, May 17, 2009 at 12:34 PM, ringemup wrote:
>
> > I'm trying to exclude
On Sun, May 17, 2009 at 12:34 PM, ringemup wrote:
>
> I'm trying to exclude some fields from an admin form, but the exclude
> option on the ModelForm is being ignored, as far as I can tell. The
> following is my code. When I view the admin page in question, "Entry
> Form
I'm trying to exclude some fields from an admin form, but the exclude
option on the ModelForm is being ignored, as far as I can tell. The
following is my code. When I view the admin page in question, "Entry
Form Initialized" is printed to the command line, but all the fields,
including blog and
On 3/5/08, Pete Crosier <[EMAIL PROTECTED]> wrote:
>
> I think you're over-estimating Django a little when it comes to
> serving media - check out
> http://www.djangoproject.com/documentation/static_files/
> for details, it requires a little more work.
Woho, it works. Thank you very much.
I think you're over-estimating Django a little when it comes to
serving media - check out
http://www.djangoproject.com/documentation/static_files/
for details, it requires a little more work.
On Mar 5, 6:19 pm, "Monica Leko" <[EMAIL PROTECTED]> wrote:
> In settings.py I have:
> MEDIA_ROOT =
In settings.py I have:
MEDIA_ROOT = 'C:/Documents and
Settings/Monica/Desktop/aab/projekt/templates/media/'
Media folder is in 'templates', and 'images' folder is in 'media'.
angry.gif is in 'images'. Following page, when requested, doesn't
show the image, only text "No image"?! I don't
yes it was, thanks.
--~--~-~--~~~---~--~~
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 email to [EMAIL
On 6/22/06, coulix <[EMAIL PROTECTED]> wrote:
> def get_absolute_url(self):
> return "/blog/tag/%s/" % (self.name)
>
> def save(self):
> print "foo"
> self.total_ref = 28
> super(Tag, self).save()
>
> "foo" [never] shows up on
imported file used space.. i was puting tab.
--~--~-~--~~~---~--~~
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,
i mean never shows up
--~--~-~--~~~---~--~~
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 email to [EMAIL
class Tag(models.Model):
name = models.CharField(maxlength=200, core=True)
total_ref = models.IntegerField(blank=True, null=True)
class Admin:
ordering = ['name']
def __str__(self):
return self.name
def get_absolute_url(self):
return "/blog/tag/%s/"
On Tuesday 20 June 2006 17:17, coulix wrote:
> when i add a tag element via the admin interface, or from a blog
> entry. total_ref is always null. why doesnt it get affected to 28 ?
> thanks
It looks OK to me. I do have similar code that sets values like this,
so it should work.
To debug,
hello, simple problem :
class Tag(models.Model):
name = models.CharField(maxlength=200, core=True)
total_ref = models.IntegerField(blank=True, null=True)
class Admin:
ordering = ['name']
def __str__(self):
return self.name
def get_absolute_url(self):
On 3/27/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> When's the book due?
> How about a chapter "migrating to Django from J2EE -- Becoming more
> productive by unlearning" or something along those lines? I'd be happy
> to proof-read it.
Hehe...Well, I've never used J2EE (or any Java at
On 3/24/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> def items(self, obj):
> return submissions.get_list(blog__id__exact = obj.id,
> order_by=('-date_submitted',), limit=5)
> - - - - - - - - - - - - - - - - - - - - - - - -
>
> According to the docs, the RSS framework should be
I'm looking but I don't see anything you are doing wrong. It's been a
while since I implemented my feeds and I vaguely remember maybe
getting an error like that at one point. What you have looks a lot
like what I have that works though. Sorry, I'm not helping much here,
but I guess I didn't
Hi.
I'm trying to put together a feed for a specific blog in my system.
I've been following the example at
http://www.djangoproject.com/documentation/syndication/#a-complex-example
Unfortunately, when I access the feed, I get:
- - - - - - - - - - - - - - - - - - - - - - - -
TypeError at
34 matches
Mail list logo