It looks like you are getting a little confused. For a start you don't
match anything for just http://localhost:8000/
(r'^$', 'urus.app.views.main')
Don't know whether thats on purpose or not. anyway.
> urlpatterns = patterns('',
> # Example:
> # (r'^urus/', include('urus.foo.urls')),
>
Julien,
It's working. It took some shuffling of import statements because I subclass
ModelForm in there for use with form.as_table
Anyway, thanx again!
Regards,
Gerard.
Julien Phalip wrote:
> The import is likely to be in your view:
>
> # views.py
> from forms import MyForm
>
> myview(requ
What is the best way to modify form data before it is saved to the
database?
I have tried the following but can't seem to get it to work, can
anyone help?
models.py
--
class MailBox(models.Model):
domain = models.ForeignKey(Domain, core=True)
address = models.Ch
Thanks guys! Using multiple forms + prefixes is exactly what I need!
Would be nice if there was some global wrapper though so you could do
validation amongst the forms but beggars can't be choosers.
On Aug 23, 2:28 am, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Aug 23, 2:33 am, Jeff Anderso
urlpatterns = patterns('',
url(r'^$', 'urus.app.views.main', name="main"),
)
And in the last version when I use this way to define the URL an invalid
syntax will popup.
2008/8/24 Handle Huang <[EMAIL PROTECTED]>
> thanks for your replay.
> but my problem is still here, the include function se
On Aug 24, 7:38 am, rmschne <[EMAIL PROTECTED]> wrote:
> I'm new to Django, and have played with Python for a few years on and
> off (not a real programmer). I'm keen to use Django to explore some
> data because of its custom data models which I plan to rely on
> extensively (putting the complex
Ah, I see what you mean. A quick glance at
http://code.djangoproject.com/changeset/4544
tell's me this is not possible to do so inside the error message, for
good reasons. To style your message take a look at
http://www.djangoproject.com/documentation/forms/#how-errors-are-displayed
and
http://ww
On Aug 24, 1:51 am, Rodolfo <[EMAIL PROTECTED]> wrote:
> Just for curiosity, why would one have two forms in a single page?
> I don't think it is possible to submit the two in a shot.
>
> Maybe only of them is intended to be filled per access?
>
> []s
>
> Rodolfo
You can't have two HTML forms per
Really no idea ?
On Aug 22, 11:01 pm, aleray <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm working with django revision 7513 and satchmo 0.7 because I heard
> they were doing nice job together. Howerver I would like to unregister
> some models in the admin interface, but I can't (and don't want to)
>
On Sun, Aug 24, 2008 at 5:04 AM, aleray <[EMAIL PROTECTED]> wrote:
> Really no idea ?
Well, you could always do the following:
>>> from django.contrib import admin
>>> help(admin.site)
Which shows you full API documentation for the AdminSite class,
listing all of its methods and what they do, i
Running Fedora and Python 2.4. Working my way through the first
installation... I've successfully run "python manage.py runserver" and
gotten the expected
Validating models...
0 errors found
Django version 1.0-beta_1-SVN-unknown, using settings 'dja.settings'
Development server is running
Thanks for the tip, I often forgot the existence of python doc!
However the thing is in the version of django I'm using there is not
admin.site, so no API to unregister. Like I said, the models are
registered with the old fashioned class admin. Then I thought I could
override that class Admin to d
Hi!
I working whit the book Practical Django Project and have a problem
with th weblog example.
(I have Django revision 8511.
I got the following error when I try to add an entry:
---
TypeError at /admin/coltrane/entry/add/
'module' object is not
On Sun, Aug 24, 2008 at 6:40 AM, aleray <[EMAIL PROTECTED]> wrote:
> Thanks for the tip, I often forgot the existence of python doc!
> However the thing is in the version of django I'm using there is not
> admin.site, so no API to unregister. Like I said, the models are
> registered with the old f
On Aug 24, 12:25 pm, "Tim Kersten" <[EMAIL PROTECTED]> wrote:
> Ah, I see what you mean. A quick glance
> athttp://code.djangoproject.com/changeset/4544
> tell's me this is not possible to do so inside the error message, for
> good reasons. To style your message take a look at
>
> http://www.djan
On Sun, Aug 24, 2008 at 7:07 AM, coan <[EMAIL PROTECTED]> wrote:
> I wonder why custom error messages are considered more dangerous than
> the help_text in the same form?
Because people do things like this:
class HackMySiteForm(forms.Form):
some_text = forms.CharField(max_length=255)
de
Daniel
You helped a lot. You are right that my code wasn't clear. I only
extracted snipets and forgot bits, e.g. talk _title and speaker_title
which are in the model but not in what I reported. Frankly, all I'm
trying to do right now is experiment to learn how this works.
Eventually, I have a
Hi All,
With some relational models in place I use droplists in the admin interface to
fill my fields. There's a 1-to-n relation between customer and project that the
admin module respects with a droplist.
The problem is that the droplist shows "customer object" for all entries
instead of a n
I played for a while and this is my result:
StaffSeq = tuple((str(i),)*2 for i in \
auth.models.User.objects.filter(is_staff=True))
(..)
models.CharField(max_length=30,choices=StaffSeq)
Are there better ways to do this?
Mark
On Sunday 24 August 2008 13:18:42 Mark wrote:
> This class
Techniques to store the confidential matters
Workflow process rules
http://www.freewebs.com/businesprocs/
Database management
http://www.freewebs.com/businesprocs/
BPMN process modeler
http://www.freewebs.com/businesprocs/
Prozessautomatisierung
http://www.freewebs.com/businesprocs/
--~--~---
On Sun, Aug 24, 2008 at 6:23 AM, James Bennett <[EMAIL PROTECTED]> wrote:
> Which shows you full API documentation for the AdminSite class,
> listing all of its methods and what they do, including this one:
(and of course if you have DJANGO_SETTINGS_MODULE set properly,
there's also the command-l
On Aug 24, 2:13 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On Sun, Aug 24, 2008 at 7:07 AM, coan <[EMAIL PROTECTED]> wrote:
> > I wonder why custom error messages are considered more dangerous than
> > the help_text in the same form?
>
> Because people do things like this:
> r
Hi all,
some time ago, I noticed that I got an error when I clicked on the
link to Documentation in the Django admin.
I also saw that admin docs had been moved from
/django/contrib/admin/templates/admin_doc/
to
/django/contrib/admindocs/templates/admin_doc/
but some part of my Django installation
This class is only for the admin page. In the following model I'd like to make
owned_by a dropdown box showing staff users.
from django.db import models
from django.contrib import admin
from django.contrib import auth
class Car(models.Model):
brand = models.CharField(max_length=20)
> Each time what? It's a development server, expected to be used as you
> develop your code. It's pretty good but not perfect about re-loading itself
I typically do a long-term development session for a day or two...
then go off an do another project for a while (a couple days.) So I'd
shut eve
Hi, I'm having some issues with the admin app (using svn rev #8520).
1) I can't get my apps models to show (logged in as superuser).
I've added:
"
class Admin:
pass
"
to each one with no affect. But I can still see them in user
permissions?!
2) The "Change password" link gives the following
This is an interesting idea that I wouldn't have thought of.
However, I'm not sure that every select is equal to a display. For
example if I load the objects via the admin.
Also, I am not sure as there would be a huge gain as the same number
or queries would still be executed, however in this c
On Sun, Aug 24, 2008 at 7:26 AM, Mark <[EMAIL PROTECTED]> wrote:
> Are there better ways to do this?
Yes.
from django.db import models
from django.contrib.auth.models import User
class Car(models.Model):
brand = models.CharField(max_length=20)
color = models.CharField(max_length=10)
You could define the __unicode__ (or __str__) method for the Customer
class:
class Customer(models.Model):
def __unicode__(self):
return '%s %s' % (self.first_name, self.last_name)
On 24.08.2008, at 15:22, Gerard Petersen wrote:
>
> Hi All,
>
> With some relational m
You should consult the documentation (not djangobook.com) about how
the admin site should be set up.
Erik
On 24.08.2008, at 17:20, Shadow wrote:
>
> Hi, I'm having some issues with the admin app (using svn rev #8520).
>
> 1) I can't get my apps models to show (logged in as superuser).
>
> I'v
En/na marsii ha escrit:
> Hi!
> I working whit the book Practical Django Project and have a problem
> with th weblog example.
>
> (I have Django revision 8511.
>
> I got the following error when I try to add an entry:
> ---
> TypeError at /admin/co
I too am unable to display the morsels.
I believe it is install correctly.
I can add morsels.
The morsel tag generates no error when the template is generated.
This is my context setting:
TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.auth",
"django.core.context_process
ah... :P thanks
But what about the "Change password" link?
Not that it really matters... but wondering if its another thing I'm
doing wrong?
cheers
On Aug 25, 12:53 am, Erik Allik <[EMAIL PROTECTED]> wrote:
> You should consult the documentation (not djangobook.com) about how
> the admin sit
En/na marsii ha escrit:
> excerp_html = models.TextField(editable=False, blank=True)
>
_
↓
excerpt_html = models.TextField(editable=False, blank=True)
You have only that mistake in the code you've attached...
Your models.py works on my system.
Cheers...
--~--~---
What Erik is saying is that in recent versions of Django you no longer
use the same syntax to activate the admin. This happened when the
newforms-admin branch was merged.
Steve
On Aug 24, 10:13 am, Shadow <[EMAIL PROTECTED]> wrote:
> ah... :P thanks
>
> But what about the "Change password" lin
sorry,
that was a "ah... (dam, silly me)"
not a "ah... (Erik is strange :s)"
;)
So I've managed to get it to work now :D
But I'm not sure why the "Change password" link still isn't working.
I'm not sure it's associated with the models?
http://dpaste.com/73515/
Cheers
On Aug 25, 1:17 am, Stev
On Sun, Aug 24, 2008 at 10:27 AM, Shadow <[EMAIL PROTECTED]>wrote:
>
> Hi, not an expert!
>
> but I think I had this same problem. The admin docs were fairly
> recently moved into a separate app. So you'll need to update your urls
> to something like:
>
> --
marsii wrote:
> I working whit the book Practical Django Project and have a problem
> with th weblog example.
>
> (I have Django revision 8511.
>
> I got the following error when I try to add an entry:
> ---
> TypeError at /admin/coltrane/entry/add
thanks for your replay.
but my problem is still here, the include function seems not work( I use the
last svn version of Django ). And you say why I having serveral different
URLS pointing to the same view is that the inculde function not work, I have
to point it directly (just to test if the view
Erik,
Marvelous! I saw this in the tutorial but I missed the part where admin uses it
as well.
Thanx and greetz!
Gerard.
Erik Allik wrote:
> You could define the __unicode__ (or __str__) method for the Customer
> class:
>
> class Customer(models.Model):
>
>
> def __unicode_
> > Are there better ways to do this?
> Yes.
> owned_by = models.ForeignKey(User, limit_choices_to={ 'is_staff': True
> })
> The model documentation covers the 'limit_choices_to' argument, as
> well as the proper syntax for setting up foreign keys.
I agree, there is plenty of documentation, I
On Sun, Aug 24, 2008 at 11:33 AM, Shadow <[EMAIL PROTECTED]>wrote:
>
> But I'm not sure why the "Change password" link still isn't working.
> I'm not sure it's associated with the models?
>
> http://dpaste.com/73515/
>
That's a bug in Django. I've opened a ticket with a patch to get it fixed:
h
That depends, if this is going to be used for single instances I would
make it a method on the model, if this is going to be used for a model
as a whole(or over a queryset), I would make it a method on a custom
manager.
On Aug 23, 6:46 pm, [EMAIL PROTECTED] wrote:
> Thanks.
>
> So if I have this:
Are yes, that too ;)
On Aug 25, 1:36 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Sun, Aug 24, 2008 at 10:27 AM, Shadow <[EMAIL PROTECTED]>wrote:
>
>
>
>
>
> > Hi, not an expert!
>
> > but I think I had this same problem. The admin docs were fairly
> > recently moved into a separate app. So
On Aug 24, 1:18 am, "Tim Kersten" <[EMAIL PROTECTED]> wrote:
> Seehttp://www.djangoproject.com/documentation/templates/#automatic-html-...
>
> Tim ^,^
It doesn't look as the form object is subject to this automatic html
escaping, because you can pass html into the form object like this:
forms.C
I ran into this problem as well when I upgraded to the most recent
django trunk. I found out about it because my tests failed the
following error:
from locale import normalize
ImportError: cannot import name normalize
Whoever is writing the patch for ticket #5494 (http://
code.djangoproject.co
Hi all:
I have a strange problem, In my project urls.py I define as follow:
urlpatterns = patterns('',
# Example:
# (r'^urus/', include('urus.foo.urls')),
# Uncomment this for admin:
(r'^admin/', include('django.contrib.admin.urls')),
(r'^site_media/(?P.*)$',
'django.vie
On Sun, 2008-08-24 at 10:14 -0700, Prairie Dogg wrote:
> I ran into this problem as well when I upgraded to the most recent
> django trunk. I found out about it because my tests failed the
> following error:
>
> from locale import normalize
> ImportError: cannot import name normalize
So you've
Ok, I was affraid of this. Now, I think I will attach a little
javascript code to hide what I don't want to see in the admin
interface. That's my best option.
Thank you very much for helping.
Best
On Aug 24, 2:01 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On Sun, Aug 24, 2008 at 6:40 AM, al
I'm new to Django, and have played with Python for a few years on and
off (not a real programmer). I'm keen to use Django to explore some
data because of its custom data models which I plan to rely on
extensively (putting the complex code there).
Try as I might, I can't see how to get them to wo
Thanks Karen and Shadow,
> > > urlpatterns = patterns('',
> > > # Admin
> > > (r'^admin/doc/', include('django.contrib.admindocs.urls')),
> > > (r'^admin/(.*)', admin.site.root),
> > > )
> > You need that in urls.py, plus you need 'django.contrib.admindocs' added
> > to your INSTALLED
Looks like my models are working. (YAY!) My save routine failed
though, but I finally figured it out. So the done() function looks
like this now:
def done(self, request, form_list):
o = PurchaseApplication()
for form in form_list:
form.instance = o
form.save(commit=False)
o
if im moving my form related logic to another file, i wouldnt really
need to import forms else where? ;)
On Aug 23, 9:10 am, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On Sat, Aug 23, 2008 at 8:59 PM, Julien Phalip <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > In Django there are no 'standar
Hi,
I'm using the newforms admin stuff, and I'd like to use my own URL for the
login page for the admin site.
So, if someone goes to /admin on my site (which is where the admin site is
located), I'd like to redirect to /private/login/?next=/admin.
(The reason I want to do that is that I have
How should I limit choices for ForeignKey fields in admin.ModelAdmin
instances based on request.user attributes, since I can't pass a request
object to the forms.ModelForm constructor?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
Useful! Thank you. :)
-I
On Aug 23, 3:11 pm, DavidY <[EMAIL PROTECTED]> wrote:
> Here is a summary of all the tutorials and docs that I have read on
> urlpatterns and generic views. It is a 2 page, concise, example code
> based cheat sheet.
>
> http://www.scribd.com/doc/4975790/urlpatterns-for-d
Hello,
I have a form that I have created and it works fine. I am now trying
to save this form. The data returned from the form spans a
relationship and should update 2 tables associated by a foreign key.
>From what I have read on the docs, because it is an unbound form I
need to write my own sav
Sérgio,
Sorry about the **kwargs thing, my fault. I'm the one who patched
AuditTrail to reflect the newest version of Django, but since I have
some custom code in there I had to go line-by-line and figure out what
to bring back to the website. I missed the **kwargs thing, though, it
seems.
-Larr
True, but it took me some figuring out and there's still some 'spaghetti'.
The import of models was needed on more then one place (next to views.py)
because of the meta class.
myforms.py:
from models import *
class CustomerForm(ModelForm):
class Meta:
model = Customer
Regards,
G
On Sun, Aug 24, 2008 at 4:56 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>wrote:
>
> Hello,
>
> I have a form that I have created and it works fine. I am now trying
> to save this form. The data returned from the form spans a
> relationship and should update 2 tables associated by a foreign key.
>
> F
Well I implemented it using a queryset.
TemplateTag that includes a template to build the filter, then a
function that will parse the queryset and apply the querystring to the
list_detail view.
I also changed my paginator templatetag so that it could parse the
Querystring through to build up the
Maybe you have an __init__.py inside locale directory?
On 16 ago, 13:12, dcoy <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to deploy my django project to my VPN (CentOS 5 python
> 2.4). I'm having ALL kinds of issues, nothing seems to work after
> following the steps in the installation docume
Also, I was wondering if you could provide me with one could do the
same thing, but with a variable.
I'm sorry if this seems a bit freeloader, but I don't quite understand
the custom tag docs and think it would be easier to learn by example
with tags that do the kind of things I'd write tags to d
Hi Richard,
Can you provide more information? What URL did you enter in the
morsel, and at what URL are you viewing the template that tries to
include the morsel? Also, does your SITE_ID setting match the site you
selected in the morsel?
Itai
On 24/08/2008, at 9:11 PM, Richard Ward wrote
If you consult the documentation, you will see it has code examples.
It seems to me that what you're looking for are inclusion tags. Django
is famous for its high quality documentation so I doubt it can't help
you.
Erik
P.S. no HTML tables for layout! :)
On 25.08.2008, at 3:05, Leaf wrote
It's me again. After yelling, "I HATE WINDOWS!", switching to Mac, and
not thinking about Django again until I upgraded to OS X 10.5 (with
Python 2.5 and SQLite 3 included), I've decided to rewrite my Dj
Styles application to brush up on my skills.
One of the fundamental concepts of Dj Styles is
I'm looking at using this as well,
have you got it working? any feedback?
g
On Jul 30, 6:29 am, Berco Beute <[EMAIL PROTECTED]> wrote:
> threadedforum(http://code.google.com/p/django-threadedforum/) seems
> like a good forum application for my site, but the documentation is
> very minimal (to sa
I was having this exact same problem.
I found a solution in chapter 20 of the Django book
http://www.djangobook.com/en/1.0/chapter20/
or see the highlighted section of the same page
http://www.diigo.com/annotated/dc0730e6af51d60cbcc6ff6a8daf847b
According to it
"If you deploy Django at a subdire
> Anurag, Thanks. That worked for me too. But it's hardly a solution.
> Now I can't use admin. I want both. Is that asking too much? Has
> anyone else any ideas?
OK, I've solved all my problems. It was my mistake. For some reason,
I had these two lines in urls.py in the reverse order:
Hello,
i'm using the stable version (0.96.2) of Django.
When newforms library try to returns a field's validation error, if
his translation contains any accent, it returns me an
UnicodeDecodeError. If i deactivate i18n in settings.py all runs
correctly (showing the messages in english).
The error
On 24 авг, 23:56, "Patrick J. Anderson" <[EMAIL PROTECTED]>
wrote:
> How should I limit choices for ForeignKey fields in admin.ModelAdmin
> instances based on request.user attributes, since I can't pass a request
> object to the forms.ModelForm constructor?
You can use ThreadLocals middleware
ht
2008/8/25 krylatij <[EMAIL PROTECTED]>:
> You can use ThreadLocals middleware
> http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
> to get current user
No.
There is no longer any reason whatsoever to use this in any way in the
admin. It was an ugly, fragile hack before and it's unn
72 matches
Mail list logo