On Sat, 2009-05-16 at 23:37 -0500, Alex Gaynor wrote:
> There isn't a better solution, a Template doesn't store the file it
> was rendered from (especially since that doesn't make sense for all
> template loaders, such as if you render a template from a string), nor
> does the context inherently h
Thanks
I actually tried that form.cleaned_data at one point but then i got
error that was something like: form object has no cleaned_data
attribute.
Anyway, its working now - thanks alot.
btw... what is tuple? i am not native english speaker so i fail to
understand some words like that.
Alan
2009/5/17 zayatzz
>
> Thanks
>
> I actually tried that form.cleaned_data at one point but then i got
> error that was something like: form object has no cleaned_data
> attribute.
Call
if form.isvalid():
# use cleaned_data
Jorge
>
>
> Anyway, its working now - thanks alot.
>
> btw... wha
>
>
> Call
>
if form.*is_valid()*: Sorry
>
> # use cleaned_data
>
> Jorge
>
>
>>
>>
--
neo2001[at]gmail.com
jorge[at]thecodefarm.com
neo[at]art-xtreme.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"D
> > btw... what is tuple? i am not native english speaker so i fail to
> > understand some words like that.
>
> It's a python data structure. It's an "" Array "" .
>
>
>
>
Thanks. :)
Alan
--~--~-~--~~~---~--~~
You received this message because you are subscribed t
This is not true for Oracle either.
A foreign key can certainly reference a unique (not primary) key in
Oracle.
See Oracle documentation, e.g.
http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/data_int.htm#sthref2329,
or simply verify by trying it !
-- PeterN
On May 16, 6:04 pm, Jo
thanks for that alex
On May 16, 9:53 pm, Ramiro Morales wrote:
> On Sat, May 16, 2009 at 5:18 PM, Alex Gaynor wrote:
>
> > On Sat, May 16, 2009 at 3:03 PM, simon101 wrote:
>
> >> Hi
>
> >> I am using ModelForms to create forms from the models [...]
> >> but it doesn't contain the id
> >> for
>
> Does anyone have any other ideas or suggestions about how to
> dynamically show templates to users in a pluggable way while at the
> same time measuring what template the user sees?
>
It's not about doing it in Django, but you know that Google Website
Optimizer does this, and provides you out
Hi
I've noticed that there have been changes in form error processing for
templates when I've been updating some old code to work with django
1.0.2 from 0.96. My code for displaying errors at the top of the pages
looked like this in 0.96:
{% if form.has_errors %}
Please correct the following er
Hi
I have looked enough and failed to identify anything that solves or
like "SaaS railskit" if I am wrong please let me know. I am not
technically savvy enough to develop such app myself.
Maybe someone is using django-paypal to make subscription based (e.g.
a.la basecamp) web app. What I want to
Hi:
When I set LANGUAGE_CODE = 'zh-cn' in the sitting file. I want to
get a 3 letters of month useing filter "date" in the template, e.g.
Useing {{ entry.pub_date|date:"M"}}, I will get "五月" in chinese, but
the one I expect is "May". How can I fix this?
Thanks!
sammysun
--~--~-~
Hi. I'm needing to learn how to dynamically pull data out of the
database and pass it as a CHOICES argument in my form. I want to pull
a recordset of options, dump it into the choices and pass it to the
form etc. Can someone out there lend me a hand? I'd like the options
on the form to be chec
Well, what I want is t implement voting application, so my users can see
article, vote for it and see the vote displayed
So I want to show in template: this page was viewed 100 times, and has 10
votes for example
how can I get those numbers
On Sat, May 16, 2009 at 12:12 PM, Antoni Aloy wrote:
>
On Sun, May 17, 2009 at 2:54 AM, newbie wrote:
>
>
> Hi,
>
>I followed those steps in the link and its working fine for
> static files (like css scripts etc). But when i'm trying to display an
> image, its not working. I'm trying to display an image which is in
> static/barcodeimages dire
On Sun, May 17, 2009 at 10:29 AM, Oleg Oltar wrote:
> Well, what I want is t implement voting application, so my users can see
> article, vote for it and see the vote displayed
> So I want to show in template: this page was viewed 100 times, and has 10
> votes for example
>
> how can I get those
>
>
> >>> from check_constraints import Check
> Traceback (most recent call last):
> File "", line 1, in
> ImportError: No module named check_constraints
This is the right code. What this is saying is that you don't have the
check_constraints module properly installed. Have you installed the
ch
On Sun, May 17, 2009 at 4:29 AM, zayatzz wrote:
>
> > > btw... what is tuple? i am not native english speaker so i fail to
> > > understand some words like that.
> >
> > It's a python data structure. It's an "" Array "" .
> >
> >
> >
> >
>
> Thanks. :)
>
> Alan
> >
>
Specifically tuple's are immu
Hi,
p=Country.objects.all() -> capturing all the records from
Country table
def country_filler(self):-> function to generate a country
list which we are going to fetch from the records
incr = 0
for i in p:
self[incr] = i.country
incr = incr+1
return self.i
On Sun, May 17, 2009 at 11:16 AM, wrote:
>
> Hi,
>
> p=Country.objects.all() -> capturing all the records from
> Country table
> def country_filler(self):-> function to generate a country
> list which we are going to fetch from the records
>incr = 0
>for i in p:
> sel
Hi Alex,
Then I can go ahead with required=false attribute to avoid form
validation and validation should be taken care by program.
Correct me if I am wrong.
Regards,
Lokesh
> > incr = 0
> > for i in p:
> > self[incr] = i.country
> > incr = incr+1
> > return self.items()
>
On Sun, May 17, 2009 at 11:24 AM, Lokesh wrote:
>
> Hi Alex,
>
> Then I can go ahead with required=false attribute to avoid form
> validation and validation should be taken care by program.
> Correct me if I am wrong.
>
> Regards,
> Lokesh
>
> > >incr = 0
> > >for i in p:
> > > self
> p=Country.objects.all() -> capturing all the records from
> Country table
> def country_filler(self): -> function to generate a country
> list which we are going to fetch from the records
> incr = 0
> for i in p:
> self[incr] = i.country
> incr = incr+1
>
Hi,
class BasicDetails(models.Model):
age = models.PositiveSmallIntegerField(null=False, blank=False)
dom = models.PositiveSmallIntegerField(null=False, blank=False)
dod = models.PositiveSmallIntegerField(null=False, blank=False)
doy = models.PositiveIntegerField(null=False, blank
On Sun, May 17, 2009 at 11:58 AM, Lokesh wrote:
>
> Hi,
>
> class BasicDetails(models.Model):
>age = models.PositiveSmallIntegerField(null=False, blank=False)
>dom = models.PositiveSmallIntegerField(null=False, blank=False)
>dod = models.PositiveSmallIntegerField(null=False, blank=Fal
Hi,
Try this below code. I guess this will solve your purpose
# pull a recordset of the users
userdata = auth_user.objects.all()
def user_filler(self):
for i in userdata:
self[i.id] = '%s, %s', (i.firstname, i.lastname)
return self.items()
Regards,
Lokesh
On May 17, 9:41
Thanks for the info, took me a while to figure out what to do next,
I haven't delved into django internals much before. I ended up
with
from django.db.models import ForeignKey
from django.forms import ModelChoiceField
class UserModelChoiceField(ModelChoiceField):
def label_from_instance(
> Try this below code. I guess this will solve your purpose
>
> # pull a recordset of the users
> userdata = auth_user.objects.all()
>
> def user_filler(self):
> for i in userdata:
> self[i.id] = '%s, %s', (i.firstname, i.lastname)
> return self.items()
>
from django import
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
oops, please modify the line from "self[i.id]='%s %s',
(i.first_name,i.last_name)" to "self[i.id]='%s %s' %
(i.first_name,i.last_name) "
On May 17, 10:28 pm, Bobby Roberts wrote:
> > Try this below code. I guess this will solve your purpose
> > # pull a recordset of the users
> > userdata = a
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 Initialized" is printed
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 some fields from an admin form, but the exclu
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 17, 2009 at 12:34 PM, ringemup wrote:
> >
>
> oops, please modify the line from "self[i.id]='%s %s',
> (i.first_name,i.last_name)" to "self[i.id]='%s %s' %
> (i.first_name,i.last_name) "
this results in the same issue:
from django import forms
from django.contrib.auth.models import User
# pull a recordset of the users
userdata = User.o
How do I add data from a fileupload to a database?
For example, if I have a Book model that is for names of books and a
FileNames model that is used on a form, how do I populate Book.title.
class FileNames(models.Model):
title = models.FileField(upload_to='tmp', blank=False)
class Book(mode
oops forgot to include:
from django.contrib.auth.models import User
On May 17, 6:18 pm, nih wrote:
> Thanks for the info, took me a while to figure out what to do next,
> I haven't delved into django internals much before. I ended up
> with
>
> from django.db.models import ForeignKey
> fro
When I attempt to use Oracle as the backend for Django, I get this
error on issuing the 'syndb' command:
"cx_Oracle.DatabaseError: ORA-00911: invalid character".
** Configuration: Python 2.5; cx_Oracle 5.0.1- 10g
** Setting: Backend=oracle; User=django; PW=django; Host=BLANK;
Port=BLANK
** C
> ... users = forms.ModelMultipleChoiceField(
> ... queryset=User.objects,
> ... widget=forms.CheckboxSelectMultiple,
> ... required=True)
> ...>>> User(username='sdc').save()
> >>> User(username='bobby').save()
dude you rock... i totally missed this. Does exactly w
On Sun, 2009-05-17 at 10:41 -0700, Bobby Roberts wrote:
> from django import forms
> from django.contrib.auth.models import User
>
> # pull a recordset of the users
> userdata = User.objects.all()
>
> def myuserlist(self):
> for i in userdata:
> self[i.id]='%s %s' %(i.first_name,i.la
I currently have a blog model:
class BlogPost(models.Model):
title = models.CharField(max_length=150)
body = models.TextField()
author = models.ForeignKey(User)
timestamp = models.DateTimeField()
Right now, author is returning the default User.username. How can I
customize the a
On Sun, May 17, 2009 at 3:51 PM, Thierry wrote:
>
> I currently have a blog model:
>
> class BlogPost(models.Model):
>title = models.CharField(max_length=150)
>body = models.TextField()
>author = models.ForeignKey(User)
>timestamp = models.DateTimeField()
>
> Right now, author is
On Sun, May 17, 2009 at 3:14 PM, Doug wrote:
>
> When I attempt to use Oracle as the backend for Django, I get this
> error on issuing the 'syndb' command:
> "cx_Oracle.DatabaseError: ORA-00911: invalid character".
>
> ** Configuration: Python 2.5; cx_Oracle 5.0.1- 10g
and Django version...?
I currently have a blog model:
class BlogPost(models.Model):
title = models.CharField(max_length=150)
body = models.TextField()
author = models.ForeignKey(User)
timestamp = models.DateTimeField()
Right now, author is returning the default User.username. I have
other models who h
I would greatly appreciate any explanations or suggested
courses of action to get to the bottom of the problem described below.
If more information would be helpful I'd be glad to supply it. I'm
using Django 1.0.
I have a search application, in prototype stage, that makes use of
regular expressio
the issue seems not to be totally solved by the patch.
If I have two classes A and B
class A has a field being a foreign key to a B class field
in the admin, when I add an A element, I see the '+' button on the
foreign key field to B even though I do not have the rights to create
a B element.
Th
Hi,
On Sun, May 17, 2009 at 10:59 PM, Thierry wrote:
>
> I currently have a blog model:
>
> [BlogPost Model]
>
> Right now, author is returning the default User.username. I have
> other models who has a ForeignKey to User, I want them to keep
> defaulting to username while for Blogpost, I want
2009/5/17 Patrick :
>
> How do I add data from a fileupload to a database?
> For example, if I have a Book model that is for names of books and a
> FileNames model that is used on a form, how do I populate Book.title.
>
> class FileNames(models.Model):
> title = models.FileField(upload_to='tmp'
Sorry, pressed that button too early:
You could also write a default method inside your BlogPost model.
Maybe something like:
class BlogPost(models.Model):
...
def author_name(self):
return '%s %s' % (self.author.first_name, self.author.last_name)
--~--~-~--~~
Hi,
2009/5/17 sammysun :
>
> Hi:
>When I set LANGUAGE_CODE = 'zh-cn' in the sitting file. I want to
> get a 3 letters of month useing filter "date" in the template, e.g.
> Useing {{ entry.pub_date|date:"M"}}, I will get "五月" in chinese, but
> the one I expect is "May". How can I fix this?
W
On Sun, May 17, 2009 at 5:34 PM, Sergio A. wrote:
>
>
> the issue seems not to be totally solved by the patch.
>
> If I have two classes A and B
> class A has a field being a foreign key to a B class field
> in the admin, when I add an A element, I see the '+' button on the
> foreign key field to
On Sun, May 17, 2009 at 5:15 PM, Karen Tracey wrote:
> On Sun, May 17, 2009 at 5:34 PM, Sergio A. wrote:
>
>>
>>
>> the issue seems not to be totally solved by the patch.
>>
>> If I have two classes A and B
>> class A has a field being a foreign key to a B class field
>> in the admin, when I add
If I have a dict that needs to be sorted and regrouped, but I want to
order the groups in a custom manner rather than alphabetically by the
regrouping key... is that feasible?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google G
On Sun, May 17, 2009 at 5:23 PM, ringemup wrote:
>
> If I have a dict that needs to be sorted and regrouped, but I want to
> order the groups in a custom manner rather than alphabetically by the
> regrouping key... is that feasible?
> >
>
The dictsort template filter just uses the default orderin
In the Django doc at
http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey,
it mentions explicitly specifying the application label in 1.0:
class Car(models.Model):
manufacturer = models.ForeignKey('production.Manufacturer')
The above is using a string for the
On Sun, May 17, 2009 at 5:31 PM, Thierry wrote:
>
> In the Django doc at
> http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey
> ,
> it mentions explicitly specifying the application label in 1.0:
>
> class Car(models.Model):
>manufacturer = models.ForeignKey('
thank you for your reply ,I will try .
On 5/17/09, Eric Abrahamsen wrote:
>
>
> On May 17, 2009, at 1:26 AM, Apple wrote:
>
>>
>> I write some code like following:
>>
>> #codi
Filenames is also a table, but I'm interested in the data withing the
file.
On May 17, 2:38 pm, Antoni Aloy wrote:
> 2009/5/17 Patrick :
>
> > How do I add data from a fileupload to a database?
> > For example, if I have a Book model that is for names of books and a
> > FileNames model that is u
On Sun, May 17, 2009 at 5:39 PM, Patrick wrote:
>
> Filenames is also a table, but I'm interested in the data withing the
> file.
>
> On May 17, 2:38 pm, Antoni Aloy wrote:
> > 2009/5/17 Patrick :
> >
> > > How do I add data from a fileupload to a database?
> > > For example, if I have a Book mo
friend ,you can do a judge operation ,mapping the English terms to the
Chinese terms . that is all your need to do .because django is
wirtten by english-spoken guys .(i am chinese but this is a
english list ,so I write english)
On 5/18/09, Kai Kuehne wrote:
>
> Hi,
>
> 2009/5/17 sammysun :
On Sun, May 17, 2009 at 5:20 PM, Ned wrote:
>
> I would greatly appreciate any explanations or suggested
> courses of action to get to the bottom of the problem described below.
> If more information would be helpful I'd be glad to supply it. I'm
> using Django 1.0.
>
> I have a search applicatio
here it is: http://code.djangoproject.com/ticket/11136
hope this will be considered, since it improves the user experience.
Thanks for your feedback, Sergio
On May 18, 12:19 am, Alex Gaynor wrote:
> On Sun, May 17, 2009 at 5:15 PM, Karen Tracey wrote:
> > On Sun, May 17, 2009 at 5:34 PM, S
Thank you for your reply, Karen. Your interpretations are correct. The
searching works fine using sqlite3 on my windows development machine.
The searching works fine on the Linux machine (Apache 2) using MySQL
as the DB engine, but blows up when I try to use the sqlite3 engine
there. I can use the
On Sat, May 16, 2009 at 6:14 PM, Alex Rades wrote:
>
> Hi,
> I have a model which looks like:
>
> class Person(models.Model):
> friends = models.ManyToManyField("self", through="Friendship")
>
> class Friendship(models.Model):
> person_a = models.ForeignKey(Person)
> person_b = models.Fore
Well, it was worth a shot. ;-) Thanks!
On May 17, 6:27 pm, Alex Gaynor wrote:
> On Sun, May 17, 2009 at 5:23 PM, ringemup wrote:
>
> > If I have a dict that needs to be sorted and regrouped, but I want to
> > order the groups in a custom manner rather than alphabetically by the
> > regroupin
On May 17, 4:23 pm, Bobby Roberts wrote:
> > ... users = forms.ModelMultipleChoiceField(
> > ... queryset=User.objects,
> > ... widget=forms.CheckboxSelectMultiple,
> > ... required=True)
> > ...>>> User(username='sdc').save()
> > >>> User(username='bobby').save()
>
o
On May 17, 4:23 pm, Bobby Roberts wrote:
> > ... users = forms.ModelMultipleChoiceField(
> > ... queryset=User.objects,
> > ... widget=forms.CheckboxSelectMultiple,
> > ... required=True)
> > ...>>> User(username='sdc').save()
> > >>> User(username='bobby').save()
>
o
On May 17, 4:23 pm, Bobby Roberts wrote:
> > ... users = forms.ModelMultipleChoiceField(
> > ... queryset=User.objects,
> > ... widget=forms.CheckboxSelectMultiple,
> > ... required=True)
> > ...>>> User(username='sdc').save()
> > >>> User(username='bobby').save()
>
o
On Sun, 2009-05-17 at 18:43 -0700, Bobby Roberts wrote:
> in my view i have this:
>
>
> if request.method=='POST':
> form=FrmIdMessage(request.POST)
> if form.is_valid(): #process valid form here
> assert False, request.POST.get('posted_to','')
> [snip]
You sho
> You should be looking in cleaned_data, see:
>
> http://docs.djangoproject.com/en/1.0/topics/forms/#processing-the-dat...
>
> For a ModelMultipleChoiceField, cleaned_data will be a list of model
> instances. You shouldn't even have to think about the pk s.
>
> sdc
yeah i'm still lost... this is
On Sun, 2009-05-17 at 20:01 -0700, Bobby Roberts wrote:
> yeah i'm still lost...
You don't need to change your form, just use form.cleaned_data in your
view. Same example, a few more lines:
>>> # our form
...
>>> from django import forms
>>> from django.contrib.auth.models import User
>>>
>>>
Hi. Is anyone aware of a django app that helps with providing social-network
sharing buttons to pages?
I'm talking about services like Add to Any (http://addtoany.com/), or the
Wordpress plugin known as Sociable (http://yoast.com/wordpress/sociable/).
Ideally this would be a django app you
Karen, thanks for your effort. It is bizarre that the problem seems to
be gone after I have restarted the computer. I don't know if I can
reproduce the situation (in fact I hope I can't).
On May 16, 6:17 pm, Karen Tracey wrote:
> On Sat, May 16, 2009 at 12:23 AM, ozgurisil wrote:
>
> > Hello al
Hi,
class Status(models.Model):
someid = models.IntegerField()
value = models.IntegerField()
status_msg = models.CharField(max_length = 2000)
so my database look like:
20 1234567890 'some mdg'
20 4597434534 'some msg2'
20 345394593'sdfgsdf'
10 450348534
On Sunday 17 May 2009 11:00:15 pm laspal wrote:
> list = Status.objects.filter(someid = 20, value < val2, value > val1)
try this:
list = Status.objects.filter(someid=20, value__lt=val2).filter(value__gt=val1)
--
Aaron Maxwell
http://redsymbol.net/
--~--~-~--~~~---~-
73 matches
Mail list logo