Yay, big thanks. It works now.
On 9 Dez., 07:30, Karen Tracey wrote:
> On Tue, Dec 8, 2009 at 4:42 PM, Lukas wrote:
> > Hi everyone,
>
> > i've a problem viewing uploaded files via the admin interface. When I
> > try to view the file, everything I get is a ValueError exception:
> > invalid liter
On 8 déc, 19:21, germ wrote:
> > The point is that utf8 can use up to 3 bytes per character...
>
> i appreciate your reply. interesting distinction between bytes and
> chars.
Been here, done that :-/
> i think i still need some more guidance. still not sure how to
> resolve with your suggestion
Lets consider a simple case with a ForeignKeyField:
class Model1(models.Model):
code1 = models.IntegerField()
code2 = models.CharField()
def __unicode__(self):
return unicode(self.code1)
class Model2(models.Model):
mycode = models.ForeignKey(Model1
On 9 déc, 06:29, chefsmart wrote:
> At what point in a modelform's lifecycle does the underlying object
> become accessible?
> Specifically, can I access the underlying object in
> a modelform's "clean" method?
> Or is it only after one does form.save
> () with or without commit = False?
Use the
use a userprofile
see http://docs.djangoproject.com/en/dev/topics/auth/, search for "userprofile"
also take a look at
http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-model/
On Tue, Dec 8, 2009 at 11:53 PM, TiNo wrote:
> On Tue, Dec 8, 2009 at 12:58, Itay Donenhirsch wrote:
>
Brilliant! Thanks.
Just to make it clear for anyone else reading, doing self.instance.pk
gives me what I want.
I am not really an expert at any level, have no formal training, and
am just poking around the "dark alley of code" to find my way, so am
just hoping what I am doing is right ;)
Regards
On Dec 9, 6:16 pm, Lakshman Prasad wrote:
> You can just replace the regex ^/comments/$ with ^/sees/comments/$ within
> the urls.py
>
> Why can't you do that?
Because it will not work.
Based on description he is mounting Django application on /sees in
Apache, likely as:
WSGIScriptAlias /see
Hi,
>
> > can't i put "from models import *" in the test code? what should i do?
>
> This happens if you import the same file using two different names. Eg, here
> you are importing it as 'from models import *'. In some other part of your
> code, you probably have 'from foo.models import *'. Pytho
>> Python treats them as
>> two different files, and hence the signal is attached twice.
> -> models.signals.post_save.connect(flaggedentry_post_save,
> sender=FlaggedEntry)
> Or is there likely to be something else we've got wrong
> in our app?
>
Well, just in case - watch out for the dispatch
Hi David,
> models.signals.post_save.connect(flaggedentry_post_save,
> sender=FlaggedEntry, dispatch_uid='mofin.store.models')
Top tip - this worked perfectly. I see this is documented only on the
wiki, I couldn't find it in the official docs.
> I've found a useful place to put signal registrati
On Thu, Nov 26, 2009 at 6:01 AM, Tom Evans wrote:
> On Thu, Nov 26, 2009 at 2:35 AM, fallhunter wrote:
>>
>> i have this code in my tests.py:
>>
>> from models import *
>>
>> and in the models.py I have a signal handler and register it with
>>
>> post_save.connect( post_save_note, sender=Note )
>
Hi all
I am very new to Django and Python and I was wondering if anyone could
help me on here as I am desperate for help.
I am designing a mobi. site and I need to somehow set an expiry date
on the competitions that will be run on the site.
I have added the field expiry date as a DateField in th
Hello,
We're not sure how can we represent the following data structure in the django
model?
Grandparent Object
First Name - NULL
Last Name - NULL
City - Anytown
Ancestor Object - NULL
Parent Object
First Name - Bob
Last Name - Smith
City
Bernard,
You need to put the url for weblog above flat pages. The empty string
'' is catching everything and it never sees your weblog url.
Mark
On Dec 8, 7:39 am, bernard wrote:
> Hi all,
>
> I am reading through the Practical Django Projects 2nd Edition book
> and i am now on the weblog entri
Bernard,
I originally replied by email, so this may get double posted. Your
problem is that you have the URL for the flat pages module above the
one for the weblog. The empty string '' is basically a catch all,
which is stopping it from ever seeing the weblog. When Django parses
the URLs, it does
Hi,
I downloaded and installed on windows Jsonpickle
In normal python script everything works fine (import jsonpickle)
but I dont know how to use it in my django app (in views import
jsonpickle doesnt work) - no module named jsonpickle
thanks for help
--
You received this message because you a
{%for jobsp in jobspecs%}
{%ifequal jobsp.id jobtitle.jobspec_id %}
{{jobsp.id}}
{%endifequal%}
{%endfor%}
-select-
{%for jobspec
Hi,
I have a setup where I need to create manually a connection to a
SQLite DB. I haven't really
succeeded in doing that so far.
More precisely, I am running a test suite which uses
django.test.utils.setup_test_environment() and
the test DB defined settings.TEST_DATABASE_NAME. That works well in
On 9 déc, 14:10, Eric Chamberlain wrote:
> Hello,
>
> We're not sure how can we represent the following data structure in the
> django model?
>
> Grandparent Object
> First Name - NULL
> Last Name - NULL
> City - Anytown
> Ancestor Object - NULL
>
> Parent Object
>
I've definitely experienced missing levels in the traceback. I don't
have anything reproducible, but notcourage isn't making it up.
On Dec 8, 8:37 am, Karen Tracey wrote:
> On Thu, Dec 3, 2009 at 1:24 AM, notcourage wrote:
> > def home (request):
>
> > if (request.user.is_authenticated())
When I login to mysql from a shell as user django_editor, I can change
tables in a database I've called django_server.
settings.py contains
DATABASE_NAME = 'django_server' # Or path to database file
if using sqlite3.
DATABASE_USER = 'django_editor'
python manage.py syncdb
results in
On Dec 9, 2:18 pm, Biju Varghese wrote:
>
> {%for jobsp in jobspecs%}
> {%ifequal jobsp.id jobtitle.jobspec_id %}
> {{jobsp.id}}
> {%endifequal%}
> {%endfor%}
>
On Dec 9, 12:07 pm, Djangobot wrote:
> Hi all
>
> I am very new to Django and Python and I was wondering if anyone could
> help me on here as I am desperate for help.
>
> I am designing a mobi. site and I need to somehow set an expiry date
> on the competitions that will be run on the site.
>
> I
I'm trying to get a better understanding of django performance in a
production setting.
Specifically I've seen notes that say that operations like sending mail
will block all production traffic to your server for the duration of the
send. That got me thinking about other backend calls, like se
Suppose I have a class "Book". Typically Django will create a table
in database for the class. If there are millions or even billions of
books, I don't want to place them into one large table. Instead, I
want to group them into different tables ("libraries"), in order to
speed up querying given
On 9 déc, 17:26, Huang Dong wrote:
> Suppose I have a class "Book". Typically Django will create a table
> in database for the class. If there are millions or even billions of
> books, I don't want to place them into one large table. Instead, I
> want to group them into different tables ("libra
Hi,
I'm not very clear on how forms work.
In the form below, both fields are required. When not filling anything
and clicking submit, I got the error messages.
Since I didn't specified any action, how can the form know that the
form is not valid and get the error messages?
Thanks for any explanat
On Dec 9, 5:14 pm, jul wrote:
> Hi,
>
> I'm not very clear on how forms work.
> In the form below, both fields are required. When not filling anything
> and clicking submit, I got the error messages.
> Since I didn't specified any action, how can the form know that the
> form is not valid and get
On Dec 8, 5:13 pm, Russell Keith-Magee wrote:
> fixture)? As always, suggestions are welcome.
The suggestion is
- template the json
- name each record
- the PK is the hash of the name
- link FKs by name, so they get the same hash
That way a reader can see an PK or FK, stick in its hash, an
After much searching, the closest answer I can find for this is here:
http://groups.google.com/group/django-users/browse_thread/thread/24edd54c637f19a7
with the "solution" being:
text = forms.CharField(label="text", max_length=10,
widget=forms.TextInput(
attrs={'size':'10',
Hi everyone. I'm using Django 1.1.0, importing it and using in another
file "robot_parser.py". I've been using it for months.
The script aggregates news from different sources and saves them using
Django ORM. Presently I used primary key for urls (http://www.site.com/
news/2009/jan/12/72828/), but
On Aug 14 2008, 5:39 am, "Hajo Smulders"
wrote:
> I need to set the HTTP_REFERER in the request.META data of a test client so
> that i can unit test a view.
> How do I do this? ie: How do i fake an HTTP header on a test client?
Bump? I just hit this problem, and the above question is the only
tr
Hello everybody
I'm new and i want to say Hello to Everybody.
I have problem with Apache. I install python, django, apache,
mod_apache and all what is necessary.
Apache configuration is:
SetHandler python-program
PythonHandler django.core.handlers.modpython
Thank you, Bruno. Your answer is really helpful and covered another
issue I hadn't noticed yet. But my question may be related to
different topic. In my example, number of "libraries" is unknown in
develop time, neither does the classification of "books".
To be more specific, I want to employ s
The problem logging in to mysql was with how I created the new user.
Nevermind :-)
JG
--
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
On Wed, Dec 9, 2009 at 11:18 AM, HUANG Dong wrote:
> Thank you, Bruno. Your answer is really helpful and covered another
> issue I hadn't noticed yet. But my question may be related to
> different topic. In my example, number of "libraries" is unknown in
> develop time, neither does the classi
For a few weeks I observe strange django behaviour - from time to time
I get mails about
AttributeError: 'NoneType' object has no attribute 'company'
in line 121, which is:
cursor.execute("SELECT * FROM interface.stats_sms_errors(%d,
'%s'::timestamp with time zone, '%s'::timestamp with time zone
OK, first let me start by saying I tried to live with the django template
processor. But I need more power. I like jinja2's macros - much slicker than
having to write a custom tag.
So I've downloaded jinja2 and installed it. Good.
After trying a couple of integration recipes on the web that
On 9 déc, 20:18, HUANG Dong wrote:
> Thank you, Bruno. Your answer is really helpful and covered another
> issue I hadn't noticed yet. But my question may be related to
> different topic. In my example, number of "libraries" is unknown in
> develop time, neither does the classification of "book
On 9 déc, 18:58, tezro wrote:
(snip)
>
> That throws an error: TypeError: 'slug' is an invalid keyword argument
> for this function.
>
> What am I doing wrong?
Not posting the full traceback - tracebacks are here to help debugging
a problem, not to fill your term with random gibberish !-)
--
That was really smart of you, thanks... Here's the traceback, hope it
helps.
---
Traceback (most recent call last):
File "", line 1, in
File "robot_parser.py", line 383, in update
news = Element(source = the_source, title = title, date =
date_published, short = short, full = full, link =
Djangoids:
Given a large application with many apps (could have been called
Packages), how to rip out a list of all of them?
My initial guess, in the subject line, naturally did not work.
--
Phlip
http://c2.com/cgi/wiki?MoreliaViridis
--
You received this message because you are subscribed
On Dec 9, 2009, at 2:11 PM, Phlip wrote:
> Given a large application with many apps (could have been called
> Packages), how to rip out a list of all of them?
Aren't they listed in settings.py?
--
-- Christophe Pettus
x...@thebuild.com
--
You received this message because you are subscribe
I would like my objects to be ordered by two (or more) fields when
viewed in the admin changelist. However, I noticed that ordering only
works for the first field listed.
I'm pretty sure this is because the order of the objects given to the
template is overridden by the javascript sort in the def
On Wed, Dec 9, 2009 at 11:50 PM, David Koblas wrote:
> I'm trying to get a better understanding of django performance in a
> production setting.
>
> Specifically I've seen notes that say that operations like sending mail will
> block all production traffic to your server for the duration of the se
> > Given a large application with many apps (could have been called
> > Packages), how to rip out a list of all of them?
>
> Aren't they listed in settings.py?
Hmm. I could have just done python shell -> INSTALLED_APPS
instead, I used find .. -name tests.py, and then some cuts and greps.
Silly m
On Thu, Dec 10, 2009 at 1:23 AM, Phlip wrote:
> On Dec 8, 5:13 pm, Russell Keith-Magee wrote:
>
>> fixture)? As always, suggestions are welcome.
>
> The suggestion is
>
> - template the json
I'm not sure how this helps. We already have a 100% reliable method
for generating JSON - it's called Si
On Thu, Dec 10, 2009 at 2:06 AM, Phlip wrote:
> On Aug 14 2008, 5:39 am, "Hajo Smulders"
> wrote:
>
>> I need to set the HTTP_REFERER in the request.META data of a test client so
>> that i can unit test a view.
>> How do I do this? ie: How do i fake an HTTP header on a test client?
>
> Bump? I ju
Todd,
I recommend that you have a look at Coffin:
http://github.com/dcramer/coffin
It comes with a {% url %} that should work out of the box.
The snippets you linked are not tags, but functions, that is, you
would do something like:
{{ url('my_view') }}
You need the pass the functions in
Did you restart Apache after making all your code changes?
Please click the Switch to copy-and-paste view link and cut and paste the
contents of the text box that will appear. The other version is not good
for pasting into email.
Karen
--
You received this message because you are subscribed to
On Wed, Dec 9, 2009 at 3:09 PM, Maksymus007 wrote:
> For a few weeks I observe strange django behaviour - from time to time
> I get mails about
>
> AttributeError: 'NoneType' object has no attribute 'company'
>
> in line 121, which is:
>
> cursor.execute("SELECT * FROM interface.stats_sms_errors(
On Dec 9, 3:10 pm, Russell Keith-Magee wrote:
> Ok; using some non-pk value for PK references is certainly one way to
> handle this. There is an issue around how to resolve a hash into an
> actual pk value, but that shouldn't be impossible.
In Rails, a YAML (JSON) fixture like this...
norber
In one of my models, I have a foreign key to Django's Site model. When
I view my model in admin, it displays the Site entries by their domain
(in the __unicode__ method). Is there any way to display the name of
the Site instead of the domain in admin?
--
You received this message because you are
Djangoes:
Here's a sketch of an XmlTestRunner.
http://pypi.python.org/pypi/XmlTestRunner/0.16654
The point is to decorate all the test names (and asserts?), and show
them off, probably with XSLT to HTML to a web page.
To plug a new test runner into Django, you apparently add to
settings.py:
TE
On Thu, Dec 10, 2009 at 7:59 AM, Phlip wrote:
> On Dec 9, 3:10 pm, Russell Keith-Magee wrote:
>
>> Ok; using some non-pk value for PK references is certainly one way to
>> handle this. There is an issue around how to resolve a hash into an
>> actual pk value, but that shouldn't be impossible.
>
>
This is a very beginner question:
Say a user has just filled out a form and hit the submit button. They
are redirected to an order confirmation page. How can I retrieve the
one row of data the user just submitted and display it on the order
confirmation page?
Here is my simple View so far, but
On Thu, Dec 10, 2009 at 8:24 AM, Phlip wrote:
> Djangoes:
>
> Here's a sketch of an XmlTestRunner.
>
> http://pypi.python.org/pypi/XmlTestRunner/0.16654
>
> The point is to decorate all the test names (and asserts?), and show
> them off, probably with XSLT to HTML to a web page.
>
> To plug a new
On Dec 9, 4:52 pm, Russell Keith-Magee wrote:
> If you want to use an XML test runner instead of the default
> Text-based runner, take a copy of django.test.simple.run_tests() and
> modify to suit your requirements.
>
> I will admit that this isn't a great solution
It is because it's easy after
On Thu, Dec 10, 2009 at 9:02 AM, Phlip wrote:
> On Dec 9, 4:52 pm, Russell Keith-Magee wrote:
>
>> If you want to use an XML test runner instead of the default
>> Text-based runner, take a copy of django.test.simple.run_tests() and
>> modify to suit your requirements.
>>
>> I will admit that this
Hello,
I want to simply render a built-in comment form in a template, using
Django's builtin commenting module, but this returns a
TemplateSyntaxError Exception.
I need help debugging this error, please, because after googling and
using the Django API reference, I'm still not getting any farther.
If you assign the output of the save() method, you'll get the created object.
Instead of:
form.save()
do:
current_order = form.save()
Then you can do whatever you like with current_order, which will be an instance
of whatever the class 'meta' is of your OrderForm, assuming that OrderForm is a
In the following bit of code:
from django import forms
class BuySellForm(forms.Form):
symbol = forms.CharField()
shares = forms.CharField()
price = forms.CharField()
print "DATA"
def clean_shares(self):
print "DATA KEYS", self.data.keys()
the BuySellForm con
P.S. Yes, the form was correctly submitted.
Thanks,
Ken
On Dec 9, 2009, at 8:16 PM, Kenneth McDonald wrote:
> In the following bit of code:
>
>
>
> from django import forms
>
> class BuySellForm(forms.Form):
> symbol = forms.CharField()
> shares = forms.CharField()
> price = forms.Ch
Hi,
Google App Engine provides a rather extensive set of tools to monitor
the performance of your applications running in App Engine. Is there
something similar for Django?
Thanks.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to thi
On Wed, Dec 9, 2009 at 8:24 PM, Kenny Meyer wrote:
>
> /urls.py[shortened]:
> urlpatterns = patterns('',
>(r'', include('posts.urls')),
>(r'^comments/$', include('django.contrib.comments.urls')),
> )
>
>
Remove the $ from the end of the pattern for the comment urls.
Karen
--
You receiv
On Wed, Dec 9, 2009 at 9:16 PM, Kenneth McDonald <
kenneth.m.mcdon...@sbcglobal.net> wrote:
> In the following bit of code:
>
>
>
> from django import forms
>
> class BuySellForm(forms.Form):
> symbol = forms.CharField()
> shares = forms.CharField()
> price = forms.CharField()
> pr
> And the code to create and validate the form is...? That might help
> in figuring out what is wrong.
>
Sure. It's just:
def buysell(request):
form = BuySellForm()
return render_to_response('buysellform.html', {'form': form})
in file 'buysell.py', and is referenced as http://..
Where would one find such beasties? Once I've taught myself Django,
I'd like to think I might be able to get some sort of job with it,
albeit a very junior one.
Thanks,
Ken
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this gro
Oops, wrong HTML down there. The actual HTML is:
{{ form.as_table }}
On Dec 9, 2009, at 9:21 PM, Kenneth McDonald wrote:
>
>> And the code to create and validate the form is...? That might help
>> in figuring out what is wrong.
>>
>
Hello,
I can't figure out how to retrieve tags for specific models i.e., I
would like to show tags for entries if I'm on a blog/entry page, tags
for links if I'm on a blog/links page, etc. If I use {{ entry.tags }}
in the templates I get duplicate tags and if an entry has more than
one tag those t
On Wed, Dec 9, 2009 at 10:21 PM, Kenneth McDonald <
kenneth.m.mcdon...@sbcglobal.net> wrote:
>
> > And the code to create and validate the form is...? That might help
> > in figuring out what is wrong.
> >
> Sure. It's just:
>
>
>
> def buysell(request):
> form = BuySellForm()
> return re
On Thu, Dec 10, 2009 at 11:21 AM, Kenneth McDonald
wrote:
>
>> And the code to create and validate the form is...? That might help
>> in figuring out what is wrong.
>>
> Sure. It's just:
>
>
>
> def buysell(request):
> form = BuySellForm()
> return render_to_response('buysellform.html', {
On Thu, Dec 10, 2009 at 12:12 PM, Rishabh Manocha wrote:
> On Thu, Dec 10, 2009 at 11:21 AM, Kenneth McDonald
> wrote:
>>
>>> And the code to create and validate the form is...? That might help
>>> in figuring out what is wrong.
>>>
>> Sure. It's just:
>>
>>
>>
>> def buysell(request):
>> fo
On 09-12-09 6:43 PM, Kegan Gan wrote:
> Google App Engine provides a rather extensive set of tools to monitor
> the performance of your applications running in App Engine. Is there
> something similar for Django?
Not that I know of. There's django-debug-toolbar and a quick hack I
wrote to track t
Thank you Daniel for your kind help. I will use your method as I think
it would be the best solution.
Have a great day.
On Dec 9, 5:37 pm, Daniel Roseman wrote:
> On Dec 9, 12:07 pm, Djangobot wrote:
>
>
>
>
>
>
>
> > Hi all
>
> > I am very new to Django and Python and I was wondering if anyone
Thanks for reply, Andy.
I am aware of django-debug-toolbar. I am looking something to run with
production.
How do people monitor Django application performance in production
environment today?
Thanks.
On Dec 10, 12:28 pm, Andy McKay wrote:
> On 09-12-09 6:43 PM, Kegan Gan wrote:
>
> > Google A
On 09-12-09 8:43 PM, Kegan Gan wrote:
> Thanks for reply, Andy.
>
> I am aware of django-debug-toolbar. I am looking something to run with
> production.
>
> How do people monitor Django application performance in production
> environment today?
Hmm I guess if I knew what you were looking for I cou
You can always place some more performance testing code inside your views:
import time
t = time.time()
search_time=0.00
#
#place some code which hits the database here
#
search_time+=time.time()-t
search_time="%.3f"%(search_time)
This does not test the memory footprint of your
hi group,
I am struck with this strange error message
Request Method: GET
Request URL:http://127.0.0.1:8000/admissions/enquiry/add/
Exception Type: AttributeError
Exception Value:
'NoneType' object has no attribute 'source'
Exception Location: /usr/local/lib/python2.6/dis
Sorry, my original description may be a bit misleading. In summary,
all I want is to create multiple table through Django's "Model" way.
Yes, I know this can be done using metaclass. I just did not know how
to integrate it into Django's model, and the impacts. Fortunately, it
seems Django has a
Performance monitoring doesn't have to be related to django itself.
There are external projects that cant do performance monitoring (CPU,
i/o, memory usage over time). You may give munin (http://
munin.projects.linpro.no/) a chance.
On Dec 10, 7:43 am, Kegan Gan wrote:
> Hi,
>
> Google App Engine
I want to design a site to replace an existing one running on my
client's Windows 2008 server.
Currently, external users are given manually generated basic auth login
credentials to view their own directory on the server. It is running
Apache 2.2 and there is zero html and no database.
The doc
On the page http://www.djangoproject.com/documentation/models/many_to_many/
under Sample API Usage
where it says: -
"
# Add a Publication directly via publications.add by using keyword
arguments.
>>> new_publication = a2.publications.create(title='Highlights for Children')
"
I think it should sa
Yes. I restart Apache every configuration change.
Error from text box:
Environment:
Request Method: GET
Request URL: http://127.0.0.1/
Django Version: 1.0.2 final
Python Version: 2.5.4
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'dj
84 matches
Mail list logo