Pass the form class to modelformset_factory() in the form argument.
The factory will then use the AuthorForm class as the base form class
when it creates the modelform class for the formset.
modelFormset = modelformset_factory(Author, form=AuthorForm)
On Tue, May 18, 2010 at 7:08 AM, Michael Davi
Hi,
I would like to ask, what is the best way to change some of the
translation messages in Django Admin to custom ones. Is there any good
way, how to override system translations of Admin in some projects
where I need it ?
Thanks
Ivan
--
You received this message because you are subscribed to t
Thanks for trying,
that didn't help.
What I actually needed to do was to
pkill python
I am writing it here in case someone later have a similar problem and
searches for this.
Pietro
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to th
pan...@pankaj-laptop:~/django_projects/pankaj$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from django.core import validators
Traceback (most recent call last):
File "", line 1, in
Impor
Hi,
I think what you're trying to accomplish is more or less what
django-tagging [http://code.google.com/p/django-tagging/] does, so I
suggest looking at its source code.
HTH,
Nuno
On Sun, May 9, 2010 at 11:24 PM, Nick Taylor
wrote:
> Hi all,
>
> I want to create my own "field" type for a model
On Tue, May 18, 2010 at 12:46 AM, Barry wrote:
> Hi--
>
> I want to dynamically display the contents of results (an array of
> dictionaries with the same keys) as a table where the column headers
> are a select group of keys in the variable result_col_titles and the
> order of the columns is the
Hi All,
After a recent svn update to my copy of Django/trunk I’ve been getting
a persistent error relating to module loading (see below). I am able
to create the same error from many but not all views/requests.
Interesting, when I run my code against a slightly older version of
Django trunk (at R
validators is a module that was added in Django 1.2.
You probably have the wrong version of Django installed or are using
Django 1.1 with a django application that requires Django 1.2.
On Tue, May 18, 2010 at 6:01 PM, Pankaj Singh
wrote:
> pan...@pankaj-laptop:~/django_projects/pankaj$ python
>
Hi everybody!
I need a User model with normal attributes inherit from models.User, but I
need some differences:
- I dont' need name, surname and another attributes
- I need that email are unique between different Users
Can I inherit and use most of models.User? Or I need to create a new cl
> Given the following:
>
> class Place(models.Model):
> name = models.CharField(max_length=50)
> address = models.CharField(max_length=80)
> zip_code = models.CharField(max_length=15)
>
>
> class Restaurant(Place):
> serves_hot_dogs = models.BooleanField()
> serves_pizza = mo
On Tue, May 18, 2010 at 6:12 PM, ben wrote:
> Hi All,
>
> After a recent svn update to my copy of Django/trunk I’ve been getting
> a persistent error relating to module loading (see below). I am able
> to create the same error from many but not all views/requests.
>
> Interesting, when I run my co
If you don't need the name, surname etc. then don't use them. They are
optional fields. You can also implement a custom form or view when the
user registers that can make sure the email has not been previously
registered.
If you need to add additional fields then you should create a custom
profile
On Tue, May 18, 2010 at 12:45 PM, Phlip wrote:
> Djangoists:
>
> The documentation for Model.objects.create(**kwargs) does not define
> kwargs. It just sez "kwargs".
>
> I think all of our experiences would bear out "kwargs" may at least be
> the model's fields.
Correct.
> But what about 'Foreig
On May 18, 12:39 am, rahul jain wrote:
> Awesome job...but I discovered just one problem. Select all missing from
> admin panel. So now i cannot select all the objects if i want to from admin
> panel. It was fine on django 1.1. Its not fine on django 1.2 nor in the
> development versions.
Works
But don't you think that have attributes that I don't need is a perfomance
lost? I only ask, I'm learning django :)
I go to see the documentation that you send me, thanks for your help.
On Tue, May 18, 2010 at 13:38, Ian Lewis wrote:
> If you don't need the name, surname etc. then don't use the
On May 18, 7:57 am, Alexandre González wrote:
> But don't you think that have attributes that I don't need is a perfomance
> lost? I only ask, I'm learning django :)
>
> I go to see the documentation that you send me, thanks for your help.
There will be a minuscule amount of overhead from the que
Hello,
Question: How do I calculate the Average of a calculated field.
My (simplified) models.py:
Manufacturer(models.Model):
name = models.CharField(length=100)
Product(models.Model):
name = models.CharField(length=100)
Items(models.Model):
manufacturer = models.Foreignkey(Manufa
Is it possible to reflect changes made through model's Manager to
model instances? For example I have ProfileManager class like so:
class ProfileManager(models.Manager):
def activate_profile(self, id, activation_key):
# do activation
And I want changes made by this method be visible
> > But what about 'ForeignKey's? May we pass their 'remote_name's in with
> > the kwargs?
>
> Foreign Keys - yes. Reverse Foreign Keys - no.
Point: All kwargs takes is the fields on this object.
> In the case of a foreign key, just pass in the object instance that
> you want your object to be re
On May 18, 11:35 am, Tom Evans wrote:
> On Tue, May 18, 2010 at 12:46 AM, Barry wrote:
> > Hi--
>
> > I want to dynamically display the contents of results (an array of
> > dictionaries with the same keys) as a table where the column headers
> > are a select group of keys in the variable result_
Roland,
Instead of using annotate, could you just add the avg_days_instock
field as another key in the select argument to extra?
Ian
On Tue, May 18, 2010 at 9:03 PM, Roland van Laar wrote:
> Hello,
>
> Question: How do I calculate the Average of a calculated field.
>
> My (simplified) models.py
On 05/18/2010 03:43 PM, Ian Lewis wrote:
> Roland,
>
> Instead of using annotate, could you just add the avg_days_instock
> field as another key in the select argument to extra?
>
Well how would I do that?
Since I want the avg_days_instock calculated on a 'group_by' basis.
To me it seems that I
Hello,
I'm not sure if this is a bug or I'm just missing something (although I have
already parsed the documentation about inlines), but:
Let's say I have a model A. Model A is an inline of model B. User U has full
access to model B, but only change permissions to model A (so, no add, nor
delete)
Hi,
I am new to django, and got some problems on models validation. I have
the following two models:
class A(models.Model):
...
class B(models.Model):
key_field = models.ForeignKey(A)
...
bool_field = models.BooleanField(default=False)
I want to add a validation rule in model B o
Roland,
Shooting a bit in the dark but how about:
...
select = {
'days_in_stock': "'%s' - transactie_datum_inkomend + 1" %
(given_date.isoformat()),
'avg_days_instock': 'AVG(days_in_stock)',
})
...
qs.annotate(Count('manufacturer'))
...
Would that get you the group by and average field y
Perfect, thanks for your help!
On Tue, May 18, 2010 at 14:03, zinckiwi wrote:
> On May 18, 7:57 am, Alexandre González wrote:
> > But don't you think that have attributes that I don't need is a
> perfomance
> > lost? I only ask, I'm learning django :)
> >
> > I go to see the documentation that
Hi I am currently using 1.1:
For the first time, I'm using a table without the built in
autoincrement field. As we know, the way to tell Django -not- to use
the "id" is to manually specify one of the fields as
primary_key=True.
Here is my table:
class Rssitem(models.Model):
url_key = models.
( Not sure what happened to the post, the subject appeared, but post
content is missing)
-
Hi I am currently using 1.1:
For the first time, I'm using a table without the built in
autoincrement field. As we know, the way to tel
Disclaimer: This may be more of a python/shared hosting issue, but
alas I'm posting here.
Hey all,
I'm currently just trying to install some 3rd party django apps so I
can use them in my project. I already have django up and running, I'm
hosting on Dreamhost using passenger. I don't have my own
On Tue, May 18, 2010 at 4:41 PM, ryan west wrote:
> Disclaimer: This may be more of a python/shared hosting issue, but
> alas I'm posting here.
>
> Hey all,
>
> I'm currently just trying to install some 3rd party django apps so I
> can use them in my project. I already have django up and running,
Hi,
I'm following the django tutorial to build the poll application. I'm
working mostly on a remote server (using wsgi), but I'm also trying
stuff on my local machine, just running the manage.py runserver
command.
I've just enabled the admin site and it works. But when I access the
page on the serv
I'll be that you can have a private site-packages directory, or whatever
you want to call it, which you can add to sys.path. You can manipulate
sys.path in your manage.py, but if you don't need to override basic
django stuff that is imported before settings.py is read, you could do
the manipulatio
Thanks Tom,
I'll have a look at that.
Ryan
>
> Google for virtualenv.
>
> Cheers
>
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this gr
Thanks! I found that by looking at the source shortly after I posted
the question. I'm surprised I didn't stumble across that option in the
documentation. Do you have a link to any documentation that indicates
this (and other features) is an option?
On May 18, 1:10 am, Ian Lewis wrote:
> Pass the
On Tue, May 18, 2010 at 5:02 PM, Bill Freeman wrote:
> I'll be that you can have a private site-packages directory, or whatever
> you want to call it, which you can add to sys.path. You can manipulate
> sys.path in your manage.py, but if you don't need to override basic
> django stuff that is imp
On Tue, May 18, 2010 at 4:27 AM, Jani Tiainen wrote:
> > Given the following:
> >
> > class Place(models.Model):
> > name = models.CharField(max_length=50)
> > address = models.CharField(max_length=80)
> > zip_code = models.CharField(max_length=15)
> >
> >
> > class Restaurant(Place):
Hey Tom,
Any idea why ./activate would be failing "Permission Denied"?
Ryan
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
djan
Just a django noob, but are you sure that the path for media is set
correctly in your settings.py file?
For instance, my media settings look like:
MEDIA_ROOT = '/home/ryanisnan/ryanwest.info/public/media'
MEDIA_URL = '/media/'
ADMIN_MEDIA_PREFIX = '/media/'
It could be that your MEDIA_ROOT are s
Because the incantation is ". activate", not "./activate". "." is a
shell command
a.k.a. source, which reads the file and executes it in the current shell. It is
not a command to run as a sub-process.
On Tue, May 18, 2010 at 1:15 PM, ryan west wrote:
> Hey Tom,
>
> Any idea why ./activate would
Hi,
Are you wrapping the insert statement in a Try? First, make sure
you're doing that.
Also, add a parameter after "except Exception" like so:
try:
instance = TableClassName.(field="a value",
user_id=request.user.id)
instance.save()
except Exception, msg <--- add this
print msg
On May 18, 9:21 am, Alexei Selivanov
wrote:
> Is it possible to reflect changes made through model's Manager to
> model instances? For example I have ProfileManager class like so:
>
> class ProfileManager(models.Manager):
>
> def activate_profile(self, id, activation_key):
> # do activ
Just wondering what happened to my response to:
Record won't Insert, possibly due to not using built in 'ID'?
It says Last Post by Steve, but the message is missing.
Steve
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this gr
Depending on your ADMIN_MEDIA_PREFIX in settings.py (default is /media/)
your webserver should be configured to point to the django admin media
location...
I have this line in my apache config
Alias /media/ /usr/share/pyshared/django/contrib/admin/media/
-Mitch
On Tue, May 18, 2010 at 9:47 AM,
On 18 May 2010 17:25, ryan west wrote:
> Just a django noob, but are you sure that the path for media is set
> correctly in your settings.py file?
>
> For instance, my media settings look like:
>
> MEDIA_ROOT = '/home/ryanisnan/ryanwest.info/public/media'
> MEDIA_URL = '/media/'
> ADMIN_MEDIA_PREF
On May 18, 10:47 am, Carlo Trimarchi wrote:
> Hi,
> I'm following the django tutorial to build the poll application. I'm
> working mostly on a remote server (using wsgi), but I'm also trying
> stuff on my local machine, just running the manage.py runserver
> command.
> I've just enabled the admin
I would like to be able to allow any template file to add its own
JavaScript. Seemed like an easy implementation:
class AddScriptNode(Node):
def __init__(self, scripts=[]):
self.scripts = scripts
def render(self, context):
context['scripts'] = self.scripts + context['scripts']
ret
And the following ugly loop adds scripts as I hoped simple
concatenation would:
def render(self, context):
for i in range(0, len(self.scripts)):
context['scripts'].insert(i, self.scripts[i])
return ''
Thomas
On May 18, 2:31 pm, Thomas Allen wrote:
> I would like to be able to allow any
On Tue, May 18, 2010 at 6:33 PM, Bill Freeman wrote:
> Because the incantation is ". activate", not "./activate". "." is a
> shell command
> a.k.a. source, which reads the file and executes it in the current shell. It
> is
> not a command to run as a sub-process.
>
As Bill says, . is the short
http://docs.djangoproject.com/en/1.2/topics/db/models/#id7
You can access sub-classes with place.restaurant and place.gardenstore
if the model has them.
I did something similar the other day but added an extra field to
parent class to indicate which type of a child model it had (1 for
Restaurant
I want to insert a html calendar into an existing web page. What is
the best way to insert html into a template that I have for the web
page?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googl
Hi,
I'd like to use proxy models to define different properties for
different kinds of pages in my Django CMS. Which proxy model/class an
object belongs to is based on a certain field's value. Before querying
the database, my view cannot know which proxy model to use for
instantiation.
What is th
Hi,
I upgraded one of my projects to 1.2 today. I noticed that one of my
model forms won't validate anymore:
class Review(Entry):
RATING_VALUE_CHOICES = (
('1', _('1. Overpriced')),
('2', _('2. Prices above average')),
('3', _('3. Average price range')),
('4',
Uups, copypasted the wrong choices list. The format is the same so
don't mind the variable name.
On May 18, 10:49 pm, Jori wrote:
> Hi,
>
> I upgraded one of my projects to 1.2 today. I noticed that one of my
> model forms won't validate anymore:
>
> class Review(Entry):
> RATING_VALUE_CHOICE
On May 18, 8:49 pm, Jori wrote:
> Hi,
>
> I upgraded one of my projects to 1.2 today. I noticed that one of my
> model forms won't validate anymore:
>
> class Review(Entry):
> RATING_VALUE_CHOICES = (
> ('1', _('1. Overpriced')),
> ('2', _('2. Prices above average')),
>
Thanks, you're correct. I don't know how I didn't notice but then
again it worked just fine with 1.1.1.
-Jori
On May 18, 11:03 pm, Daniel Roseman wrote:
>
> It's an integer field, but the choices are all strings. The first
> value in each tuple should be an integer, to match the field.
> --
> DR
Hi, I've encountered the same problem. When I look in the page source
the link point to the correct localization, but the CSS and images
aren't loaded, the layout is default. Could anyone help us? :)
Thanks!
On May 17, 8:37 am, naos wrote:
> Well now I think that it might be related to virtuale
Hi all,
Can you give me a bright explanation for Django Framework ? how can
Django being configure in cloud computing? it's support? can you give
me some link article for this ?
Thanks Before that..
Sincerely
Hendra
--
You received this message because you are subscribed to the Google Groups
If I have two URLs which resolve to the same view. Is there any way to
get both? I rely on reverse() for some "active page" logic and the
trouble is that it will only return a single URL, the first match it
has encountered.
Thomas
--
You received this message because you are subscribed to the Go
I need some more info :)
I've get this: http://img138.imageshack.us/img138/200/descargan.png it's
pretty but need to change somethings...
1. *I need that user be a EmailField unique. User is defined in auth.User
so I don't know how change it.*
2. In "User Profiles" I like to change the t
Hi everybody,
Is there a way i can localize some of the form fields from the ModelForm
class or ModelAdmin class?
--
--
Dejan Noveski
Web Developer
dr.m...@gmail.com
Twitter: http://twitter.com/dekomote | LinkedIn:
http://mk.linkedin.com/in/dejannoveski
--
You received this message because you
I am having an issue with an authentication app I am writing. The app
saves the form appropriately but doesn't send the confirmation email.
I am using the same email_host settings as with other application that
send email messages but with no results. Here is the process.
First a form processes th
what happens if you set fail_silently to True?
On May 19, 12:05 am, Nick wrote:
> I am having an issue with an authentication app I am writing. The app
> saves the form appropriately but doesn't send the confirmation email.
> I am using the same email_host settings as with other application that
I get the same result.
I dropped into the shell and ran this
>>> user = User(username="test", email="t...@test.com")
>>>send_activation(user)
1
I don't really know what that 1 means, though.
On May 18, 5:08 pm, "ge...@aquarianhouse.com"
wrote:
> what happens if you set fail_silently to True?
>
I get the same results.
I dropped into the shell and tried it out
>>> user = User(username="nick", email="t...@test.com")
>>> send_activation(user)
1
I think the 1 means that it passed but I don't get any emails sent
On May 18, 5:08 pm, "ge...@aquarianhouse.com"
wrote:
> what happens if you se
Make one of the urls pass an argument using parentheses in the pattern. Then
make that an option argument in the view function. Reverse will return one if
you supply the argument, and the other if you don't.
But why not use named patterns and reverse by pattern name?
In either case you have to
LinkedIn
Nitzan Brumer requested to add you as a connection on LinkedIn:
--
David,
I'd like to add you to my professional network on LinkedIn.
- Nitzan
Accept invitation from Nitzan Brumer
http://www.linkedin.com/e/9FjGxeSxbe2CaYJw_BjdQigBBG4n
OK, it's all fixed. I updated the template rendering to actually use
Context, if you look at activate.py I just put "context = ({". That's
not helping anything out. I also added a default_host_email to the
settings file. I don't know if that was the problem, but I'm leaving
it in.
On May 18, 5:19
Actually, I've fixed the problem with send_activation. If i go via the
form it still doesn't trigger the email.
On May 18, 5:19 pm, Nick wrote:
> I get the same results.
>
> I dropped into the shell and tried it out
>
> >>> user = User(username="nick", email="t...@test.com")
> >>> send_activation
On May 18, 2:00 pm, CrabbyPete wrote:
> I want to insert a html calendar into an existing web page. What is
> the best way to insert html into a template that I have for the web
> page?
In what form do you have this calendar HTML? Do you compute it in a
view? Is it already in a file? If you have
Hi,
I want to sync emailadresses in the django.contrib.auth User model, to a
sympa mailinglist subscriberlist.
I really don't have any experience with sympa. So I don't know how this
process usually goes,
but what I did found out, is that sympa documentation is lacking a bit.
I find the concepts t
On May 18, 9:57 am, Matt W wrote:
> Hello Everyone,
>
> I just started to use Django and I was wondering how I could setup
> javascipt (AJAX to be more specfic) in my djagno project in order to
> run a script. Here is the script code.
>
[snip]
>
> In specific I was wondering where I place the sour
Hi,
I'm new to Django -- looking to write a credit card transaction module and I
need the ability to perform a "SELECT FOR UPDATE" (mysql) so that an order
does not get processed by two different threads.
I see an open ticket for this here:
http://code.djangoproject.com/ticket/2705
Has anyone su
I'm pretty sure that modelformset_factory is not documented.
2010/5/19 Michael Davis :
> Thanks! I found that by looking at the source shortly after I posted
> the question. I'm surprised I didn't stumble across that option in the
> documentation. Do you have a link to any documentation that indic
Hi,
I am a beginner with Django. Can someone tell me how to access the database
of Wikimapia using its API through Django.
--
Regards,
Rav!
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@goog
class People(forms.Form):
HoldComments=models.ManyToManyField('Comment')
class Comment(forms.Form):
CommentWord=models.CharField(max_length=1)
I've had these two tables, I'd want the people make a comment so I new
p=comment(CommentWord=Comment)in the view
but how can I sav
Models:
from django.db import models
class People(models.Model):
name = models.CharField(max_length=30)
class Meta:
db_table = 'libs_peoples'
class Content(models.Model):
title = models.CharField(max_length=30)
peoples = models.ManyToManyField(Peo
Hi,
CSS files are not loading when i try to access the admin screens.
Here are the settings.py config file details
MEDIA_ROOT = ''
MEDIA_URL = 'http://127.0.0.1:8000'
ADMIN_MEDIA_PREFIX = '/media/'
Could some one please provide me help on this.
Thanks a lot.
--
You received this message becau
Hi,
I just tried the new Model Validation feature in Django 1.2 and I
found out that ModelForm always calls the Model's clean method even
when the form validation has errors. This causes problems when the
model has a foreign key, and the value is validated in the clean
method. Consider this exampl
Hello,
I know that Django code and templates are should not sit in the root
and the same path with Apache. Is there a recommendated location for
deploying the Django app? Also, what is the best practice in terms of
the user account and group the Django folder should use?
Let's say on the virtual
Hi,
I want to include a search button inside my Django, which retrieves data
from some google API or Wikimapia API, But i am stuck with adding a search
option inside Django. i am a beginner with Django and Python programming.
Can somebody please help me with this.
--
Regards,
Rav!
--
You receiv
80 matches
Mail list logo