Yup It worked! I saved the form with excluded foreign key with commit=False.
Then set the proper instance to foreign key and then saved. It worked just
fine.
Thanks for the help :)
On Thu, Aug 27, 2009 at 10:47 PM, Shawn Milochik wrote:
>
> There are different options,
On Thu, Aug 27, 2009 at 5:56 PM, Sam Tregar wrote:
> On Thu, Aug 27, 2009 at 5:47 PM, Alex Gaynor wrote:
>>
>> Instead of iterating over the QuerySet itself, use
>> QuerySet.iterator(), this will avoid populating the result cache.
>
> Thanks, works great!
On Thu, Aug 27, 2009 at 2:21 PM, Gregor Müllegger wrote:
>
> Hi,
>
> i have an issue with the standard test runner of django. If i try to
> run the testsuite of an app everything gets executed in the right
> fashion. While all executed tests pass without errors, the test
On Thu, Aug 27, 2009 at 2:03 PM, nixon66 wrote:
> register.filter(uscurrency)
should be
register.filter ('uscurrency', uscurrency)
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Hello.
I have project design question. Imaging that we have page with simple search
form at the top and search results at the bottom of the same page. And every
row of result table has a link to another page (edit/view this founded
item). After user clicking this link he goes to another page (for
Hi,
i have an issue with the standard test runner of django. If i try to
run the testsuite of an app everything gets executed in the right
fashion. While all executed tests pass without errors, the test method
"test_string_regex" is not evaluated! If i rename the method to any
athor name like
Hello ppl,
may somebody help me?
I need to integrate widgets like iCalender or a chat into Django.
How do I do it correctly?
Thx!
Jenny
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
Hi all,
I have django-tinymce spellchecker working perfectly on my local
machine which is Ububtu.
But as soon as, I deploy it on a web host (CentOS), it gives me
problems. Specifically, when I click the specllchecker button,
following errors are logged:
Traceback (most recent call last):
File
On Thu, Aug 27, 2009 at 5:47 PM, Alex Gaynor wrote:
>
> Instead of iterating over the QuerySet itself, use
> QuerySet.iterator(), this will avoid populating the result cache.
>
Thanks, works great! This would make a good addition to the manual section
that describes how
Thanks. I will check out your suggestions.
On Aug 26, 6:07 am, Peter Bengtsson wrote:
> You can add and modify fields on a form in the form's __init__
> function.
>
> class MyForm(forms.Form):
> country = forms.ChoiceField()
> def __init__(self, *args, **kwargs):
>
There are different options, depending on whether the instance of B is
a required part of A's model.
1. You can add an "exclude" section to your ModelForm of A. Validate
BForm, validate AForm, then take the resulting instance of A and set
it's 'b' attribute to the resulting instance of
Still getting the same errors.
On Aug 27, 7:10 pm, Javier Guerra wrote:
> On Thu, Aug 27, 2009 at 2:03 PM, nixon66 wrote:
> > register.filter(uscurrency)
>
> should be
>
> register.filter ('uscurrency', uscurrency)
>
> --
> Javier
The file is mytag.py and the directory is now called templatetags
On Aug 27, 4:42 pm, Daniel Roseman wrote:
> On Aug 27, 8:03 pm, nixon66 wrote:
>
> > I've just created a template tag as described in the documents, but
> > keep getting errors.
>
> >
I found this thread:
http://stackoverflow.com/questions/660260/django-admin-form-for-many-to-many-relationship
on Stackoverflow, but when i try the suggested TabularInline thing i get the
error:
has no ForeignKey to
Greetings
Sven
On Thu, Aug 27, 2009 at 5:03 PM, Thomas Guettler
Made the changes and still getting the same error.
On Aug 27, 3:11 pm, Javier Guerra wrote:
> i only see a couple of minimal typos, could be your problem:
>
> > In an installed app I created a directory called Templatetags. I
>
> should be 'templatetags', no capitalization.
On Thu, Aug 27, 2009 at 5:34 PM, Sam Tregar wrote:
> Hey all. So, I figured out how to run my QuerySet through MySQLdb's
> SSCursor! Woo!
>
> Bad news: it's still using a ton of memory. As far as I can tell it's being
> used by QuerySet's internal _result_cache which is
The queue idea is a good one, and you can use Gearman to do that really
easily. Another, even simpler, way to handle this is to use some kind of
shared NFS mount for the storage. All things being equal, scaling a filer or
SAN will be much easier than scaling your DB, specially if - like most
Hey all. So, I figured out how to run my QuerySet through MySQLdb's
SSCursor! Woo!
Bad news: it's still using a ton of memory. As far as I can tell it's being
used by QuerySet's internal _result_cache which is holding all the rows
retrieved by the query. Is there any way to turn this cache
On Thursday 27 August 2009 08:36:25 am garagefan wrote:
> i've taken the project directly from github and attempted to run
> python setup.py install and get the same error:
>
> running install
> error: invalid Python installation: unable to open /usr/lib/python2.5/
> config/Makefile (No such file
On Thu, Aug 27, 2009 at 12:18 PM, Sandra Django wrote:
> Hi, I want display in change_list view, user who added an object and date. I
> did that:
> - models.py ---
>>
>> class One(models.Model):
>> ..
>> def user(self):
>>
Hi, I want display in change_list view, user who added an object and date. I
did that:
- models.py ---
>
> class One(models.Model):
> ..
> def user(self):
> return self.user.username
>
> def date(self):
> return self.date
> --
On Aug 27, 8:03 pm, nixon66 wrote:
> I've just created a template tag as described in the documents, but
> keep getting errors.
>
> In an installed app I created a directory called Templatetags. I
> created a blank __init__.py file and a file called mytag.
Is the file
Sorry if I'm getting a little far out here.
I have two models, a parent and a child with a FK relationship (See
the code below for example) and I have a method in each called
is_owner. For the child it checks to see if a user passed is the
objects owner OR if that user passes the parents
i only see a couple of minimal typos, could be your problem:
> In an installed app I created a directory called Templatetags. I
should be 'templatetags', no capitalization.
> created a blank __init__.py file and a file called mytag. Mytag has a
> function
>
> from django import template
>
>
On Thu, Aug 27, 2009 at 5:00 PM, Thomas Guettler wrote:
>
>
>
> Maksymus007 schrieb:
>> On Thu, Aug 27, 2009 at 1:22 PM, David Zhou wrote:
>>> On Thu, Aug 27, 2009 at 7:09 AM, Maksymus007 wrote:
I've got two different form on the
I've just created a template tag as described in the documents, but
keep getting errors.
In an installed app I created a directory called Templatetags. I
created a blank __init__.py file and a file called mytag. Mytag has a
function
from django import template
register template.Library()
def
Hello,
I would like to add shopping cart features to a current web
application. Has anyone solved this type of problem? What did you
do? Roll your own features (add to cart, view cart, payment, etc)?
Use Satchmo? Use something else?
Thanks
Gene
I'm trying to get a queryset to issue its query over a different DB
connection, using a different cursor class. Does anyone know if that's
possible and if so how it might be done? In psuedo-code:
# setup a new db connection:
db = db_connect(cursorclass=AlternateCursor)
# setup a generic
doh, forgot that i never installed python-devel, der... everything
works now, nothing to see here... no novice server users here >_>
On Aug 27, 11:36 am, garagefan wrote:
> i've taken the project directly from github and attempted to run
> python setup.py install and get
Hi,
I had the same question some time ago and found no answer,
but maybe you try harder.
Sven Richter schrieb:
> Hi,
>
> i have a new problem with my many-to-many field.
>
> I have two models A and B.
> A(models.model):
> b = models.ManyToManyField('app.B')
>
> Now when i edit A in the
Lewis Taylor wrote:
> Is there a better solution django offers, and why are
> blobs not supported. ideally i would have the image stored in DB and
> that way there would never be sync issues.
>
FWIW (which given you're concerned about scaling mightn't be all that
much), it's fairly
On Thu, Aug 27, 2009 at 11:02 AM, RubenK wrote:
>
> Thanks for the help! It worked! How would I go about hiding the field?
>
I think you would have to go all the way and put the form on the model
admin, which really isn't difficult. Follow this:
Maksymus007 schrieb:
> On Thu, Aug 27, 2009 at 1:22 PM, David Zhou wrote:
>> On Thu, Aug 27, 2009 at 7:09 AM, Maksymus007 wrote:
>>> I've got two different form on the same page, under the same URL.
>>> When I send one of them, the second one gets
i've taken the project directly from github and attempted to run
python setup.py install and get the same error:
running install
error: invalid Python installation: unable to open /usr/lib/python2.5/
config/Makefile (No such file or directory)
i assume then, i need to install Makefile? I've
Thanks for the help! It worked! How would I go about hiding the field?
On Aug 27, 4:28 pm, Michael wrote:
> On Thu, Aug 27, 2009 at 9:55 AM, RubenK wrote:
>
> > I've setup my 'prepopulate_fields' so that it should automatically
> > enter a slug in the
That's exactly what I needed. Thanks a lot.
--
Gijs
On Aug 27, 4:31 pm, David Zhou wrote:
> On Thu, Aug 27, 2009 at 10:10 AM, gnijholt wrote:
> > Or is there a better way to generate a full archive page (per year,
> > per month)?
>
> You'll need to
Look at django-oembed. A CharField will serve for every (supported)
provider.
On Wed, Aug 26, 2009 at 8:17 PM, thornomad wrote:
>
> Hi - need some suggestions.
>
> I am trying to put together an app that allows users to submit links
> to videos at popular video sharing
On Aug 27, 2:55 pm, RubenK wrote:
> I've setup my 'prepopulate_fields' so that it should automatically
> enter a slug in the admin site, however when I click the 'add' link
> it gives me the following error:
>
> "Key 'slug' not found in Form"
>
> I've triple checked all my
On Thu, Aug 27, 2009 at 10:10 AM, gnijholt wrote:
> Or is there a better way to generate a full archive page (per year,
> per month)?
You'll need to test this, but you should be able to do that with {%
ifchanged %}:
#view:
posts = Posts.objects.order_by('-pub_date')
On Thu, Aug 27, 2009 at 9:55 AM, RubenK wrote:
>
> I've setup my 'prepopulate_fields' so that it should automatically
> enter a slug in the admin site, however when I click the 'add' link
> it gives me the following error:
>
> "Key 'slug' not found in Form"
>
> I've triple
I've setup my 'prepopulate_fields' so that it should automatically
enter a slug in the admin site, however when I click the 'add' link
it gives me the following error:
"Key 'slug' not found in Form"
I've triple checked all my models and database tables and everything
seems to be in order so I'm
Hello Django-users,
Actually it's more of a basic Python problem than a Django problem.
I'll try to be brief:
In the view, I'm looping through my posts as such:
---
def archive(request):
years = Post.objects.dates('pub_date', 'year')
for year in years:
print year.year
I don't know what else is wrong but:
On Wed, Aug 26, 2009 at 8:15 PM, MIL wrote:
>bits = token.contents.split()
should probably be:
bits = token.split_contents()
and render must return a string whether or not there is an
ObjectDoesNotExist exception, so,
Thanks, both of you :o)
I tried using it directly in my template like
{{object.__class__.__name__}}
But that didnt work.
So I did it by adding this to my models:
def get_model_name(self):
return self.__class__.__name__
And it works
Thanks again :o)
On 27 Aug.,
On Thu, Aug 27, 2009 at 7:58 AM, Maksymus007 wrote:
>
> On Thu, Aug 27, 2009 at 1:41 PM, David Zhou wrote:
> >
> > On Thu, Aug 27, 2009 at 7:33 AM, Maksymus007
> wrote:
> >>
> >> On Thu, Aug 27, 2009 at 1:22 PM, David
On Thu, Aug 27, 2009 at 1:41 PM, David Zhou wrote:
>
> On Thu, Aug 27, 2009 at 7:33 AM, Maksymus007 wrote:
>>
>> On Thu, Aug 27, 2009 at 1:22 PM, David Zhou wrote:
>>> Post the part of your view that handles your forms.
>>
>> Nothing
thanks i got the solution
On Thu, Aug 27, 2009 at 4:28 PM, Matthias Kestenholz <
matthias.kestenh...@gmail.com> wrote:
>
> On Thu, Aug 27, 2009 at 12:38 PM, ankit rai wrote:
> > Nobody knows the answer to this question i think so
> >
>
> Did you really expect an answer
On Thu, Aug 27, 2009 at 7:33 AM, Maksymus007 wrote:
>
> On Thu, Aug 27, 2009 at 1:22 PM, David Zhou wrote:
>> Post the part of your view that handles your forms.
>
> Nothing special
>
> if request.method == 'POST':
> form =
On Thu, Aug 27, 2009 at 1:22 PM, David Zhou wrote:
>
> On Thu, Aug 27, 2009 at 7:09 AM, Maksymus007 wrote:
>>
>> I've got two different form on the same page, under the same URL.
>> When I send one of them, the second one gets validated too.
>> I set
On Thu, Aug 27, 2009 at 6:58 AM, Matthias
Kestenholz wrote:
>
>> On Thu, Aug 27, 2009 at 2:59 PM, ankit wrote:
>>>
>>> I am new to django.I having to app in my admin.Know I want to know
>>> that how can i redirect user to one app listpage if
On Thu, Aug 27, 2009 at 7:08 AM, Léon Dignòn wrote:
>
from django.contrib.auth.models import User
u = User.objects.get(id=1)
u
>
print u
> leon
type(u)
>
Alternatively:
>>> u.__class__.__name__
'User'
-- dz
On Thu, Aug 27, 2009 at 7:09 AM, Maksymus007 wrote:
>
> I've got two different form on the same page, under the same URL.
> When I send one of them, the second one gets validated too.
> I set prefixes but no change.
>
> Is there any way to distinguish between two forms,
Hello,
simply use type()
>>> from django.contrib.auth.models import User
>>> u = User.objects.get(id=1)
>>> u
>>> print u
leon
>>> type(u)
-ld
On Aug 27, 11:59 am, MIL wrote:
> Hello :o)
>
> I would like to know how to get the model name of an object.
>
> sort of like
I've got two different form on the same page, under the same URL.
When I send one of them, the second one gets validated too.
I set prefixes but no change.
Is there any way to distinguish between two forms, choosing one that
have been submited?
On Thu, Aug 27, 2009 at 12:38 PM, ankit rai wrote:
> Nobody knows the answer to this question i think so
>
Did you really expect an answer within an hour of sending the email to
the list? A little bit of patience would really be in order here.
If you need answers _fast_,
Nobody knows the answer to this question i think so
On Thu, Aug 27, 2009 at 2:59 PM, ankit wrote:
>
> Hello,
>
>
> I am new to django.I having to app in my admin.Know I want to know
> that how can i redirect user to one app listpage if clicks save on
> second app.say from
On Thu, Aug 27, 2009 at 6:13 AM, Lewis
Taylor wrote:
>
> I have an imagefield that i want to create a thumbnail for on approval
> of the image. The problem is (setup is 2 django instances, load
> balancer and DB) if the image is stored on one machine it's not the
>
I have 2 models say A and B, B has A has a foreign key reference to A.
There is a model form created for mode B called as BForm. Now If i
create instance of BForm and display it in a page, foreign key field
appears as a drop down choice box in the form. Instead of this if i
set instance of B to
Question:
I have an imagefield that i want to create a thumbnail for on approval
of the image. The problem is (setup is 2 django instances, load
balancer and DB) if the image is stored on one machine it's not the
cleanest solution to have to get the image from the other server and
process it. Is
Hello :o)
I would like to know how to get the model name of an object.
sort of like object.get_model_name or something like that
Is there a way to that.
I tried altering my model something like this, but it doesnt work:
def get_model_name(self):
return '%s'%(class)
Hello,
I am new to django.I having to app in my admin.Know I want to know
that how can i redirect user to one app listpage if clicks save on
second app.say from app2 to app1
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Hi,
i have a new problem with my many-to-many field.
I have two models A and B.
A(models.model):
b = models.ManyToManyField('app.B')
Now when i edit A in the admin interface everything is ok, i can select all
B instances A belongs to.
What i need now is to be able to do the same thing from
Hi.I have a problem with my filter. I want to filter date and time but
filter is not working.I am sending my models.py
from django.db import models
from datetime import datetime
from datetime import date
from datetime import time
class Randevu(models.Model):
def __unicode__(self):
Thanks, it looks like a good very light example, how to build such a
framework. What is good I am thinking in a good way, just no adequate
framework exists yet.
On 26. Aug, 18:14 h., Daniel Roseman wrote:
> On Aug 26, 4:14 pm, gentlestone wrote:
>
Apache is running under a system account. A quick test of running
Apache under my user account enabled printing indeed. I'll follow your
suggestion and create a dedicated user with restricted rights to run
Apache under.
Thanks so much for your help
Marc
On Aug 27, 2:42 am, Sam Lai
I just got off the phone with godaddy for the last time. I've canceled
my hosting with them as they are reluctant to install python-sqlite2.
Something as simple as database libraries that can be yum installed
and they wouldn't budge. They really wanted me to switch to VPS with
them. It took me 2
take a look at that discussion:
http://groups.google.com/group/django-users/browse_thread/thread/1de89cdee99b1086
lerner wrote:
> def output(request):
> response = HttpResponse(mimetype='text/csv')
> response['Content-Disposition'] = 'attachment; filename=%s' %
> 'address.csv'
> t =
67 matches
Mail list logo