Indeed, I'm using optional (and nullable) ForeignKeys in other places as well.
The problem with an optional ForeignKey to Django's contrib sites.Site model,
is that it breaks the "View on site" button in the admin section.
near line 60 in /django/contrib/contenttypes/views.
Actually, you can have a nullable ForeignKey (and there can be good
reasons for this). This is mentioned in the docs themselves; see:
https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.on_delete
I am not sure about the error that the OP is encountering.
On May
...
Hi,
I have a model which has a ForeignKey to the Django contrib sites.Site model.
This field should be optional.
If it is optional it is not a foreign key. You can put a constraint on
the field to have a non-null value be present in the other table, and
perhaps there is a way to do this
er, I'm running into a problem on the admin, when I want to use the "View
on site" button.
It fires an AttributeError: "'NoneType' object has no attribute 'domain'" with
objects for which I leave this field empty.
Is this a bug in /django/contrib/conte
On Tue, Mar 15, 2011 at 5:28 PM, Tomas Cirip wrote:
> I am trying to understand 'view on site' functionality. From what I
> read it is supposed to use model's get_absolute_url() to create 'view
> on site' link. However, when I look at Django-1.2.5/djang
I am trying to understand 'view on site' functionality. From what I
read it is supposed to use model's get_absolute_url() to create 'view
on site' link. However, when I look at Django-1.2.5/django/contrib/
admin/templates/admin/change_form.html code:
{% t
tl;dr version:
admin "view on site" link returns the first Site associated with a
model, rather than the current Site. Is this correct? It seems that it
should return the current site (if it is picking one arbitrarily)
-Sam
On Jun 29, 11:19 pm, Sam wrote:
> Hello,
>
> I
Hello,
I'm using a model with a many to many relationship to Site. I noticed
that the redirect from the admin site (the link "View on Site") is to
a domain that is not associated with the current SITE_ID. in other
words I have two sites, "devel.domain.com" and "
On Mon, Apr 26, 2010 at 12:59 AM, Francis Gulotta wrote:
> The latest patch in that ticket's comments seems to work for me. Being new
> to the project may I ask, is this ticket not closed due to lack of tests or
> have a stumbled upon a design disagreement?
The latest patch attached is lacking te
I get a "DatabaseError: (1146, "Table 'project.django_site' doesn't exist")"
error when clicking on a "View on site" link. I'd rather not use the
framework as the url is changing around with development and deployment
quite frequently. I think
Thanks, rebus. When I added an other piece of information to the
information in your links, I got this to work.
In this case there will be a string, a username, in the url. I have
browsed the documentation and it mostly talks about digits. Then you
are supposed to put a d+ for instance in the url.
On 12 March 2010 01:04, Robert wrote:
> There is a "View on site" link when you edit a user in admin.
>
> The link calls the url user/user_name but you have to make the url-
> view configuration yourself apparently.
>
> I wonder if there is a "built-in"
There is a "View on site" link when you edit a user in admin.
The link calls the url user/user_name but you have to make the url-
view configuration yourself apparently.
I wonder if there is a "built-in" way to do this. I looked up an other
thread from 2006 that deals wi
Getting a
NoReverseMatch at /admin/r/14/1/ on a model in Admin
Here's the traceback:
Traceback:
File "/home/queryclick/webapps/django/lib/python2.5/django/core/
handlers/base.py" in get_response
86. response = callback(request, *callback_args,
**callback_kwargs)
File "/home/qu
Hi,
On 25.10.2008 13:48 Uhr, felix wrote:
> its gets the domain value from the Site object. I'm guessing that you
> have that domain set to "localhost"
thank you very much. That was excatly the problem.
Setting the site to localhost:8000 did the trick.
adi
--
Adi J. Sieker mobile: +4
.0.0:8000"
site.save()
-flx
On Fri, Oct 24, 2008 at 11:15 PM, Adi Jörg Sieker <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I just noticed that the "View on site" link on the Admin change entry
> page redirects to localhost/. The dev server is running on
> local
wrote:
> Hi,
>
> I just noticed that the "View on site" link on the Admin change entry
> page redirects to localhost/. The dev server is running on
> localhost:8000 though.
> The model being used is the Entry model from coltrane_blog[1] which has
> a get_absolut_ur
Hi,
I just noticed that the "View on site" link on the Admin change entry
page redirects to localhost/. The dev server is running on
localhost:8000 though.
The model being used is the Entry model from coltrane_blog[1] which has
a get_absolut_url method that looks like:
from
> wrote:
> Am Dienstag, 28. November 2006 18:03 schrieb conrad22:
>
> > How do I get the 'View on site' link that appears in the Django
> > interface to work?
> > I've tried adding the following to my urls.py
>
> > (r'^r/', include(
Am Dienstag, 28. November 2006 18:03 schrieb conrad22:
> How do I get the 'View on site' link that appears in the Django
> interface to work?
> I've tried adding the following to my urls.py
>
> (r'^r/', include('django.conf.urls.shortcut')),
>
How do I get the 'View on site' link that appears in the Django
interface to work?
I've tried adding the following to my urls.py
(r'^r/', include('django.conf.urls.shortcut')),
But didn't do anything!
Thanks!
--~--~-~--~~~---
On 8/27/06, Michael van der Westhuizen <[EMAIL PROTECTED]> wrote:
> On 8/27/06, Alan Green <[EMAIL PROTECTED]> wrote:
> > I'm having a problem with the Admin "View on site" button. According
> [snip]
> > My model objects have a get_absolute_url() metho
View on Site broken with move over to Apache/mod_python.
I have moved my Django 0.91 project (idms, the application under the
idms project is called "pra" with several more apps to come) from my
development server over to Apache/mod_python on Windows XP SP1.
Everything was working fine
Thanks a lot Konstantin
:) it works
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send emai
On 3/2/06, Mary Adel <[EMAIL PROTECTED]> wrote:
>
> I did that but their is something that is very strange happened when i
> click on the view on site button it goes to microsoft site which is
> strange for me :(
You should edit details about your Site object in Admin appli
I did that but their is something that is very strange happened when i
click on the view on site button it goes to microsoft site which is
strange for me :(
On Thu, 2006-03-02 at 18:00 +0530, Amit Upadhyay wrote:
> Hi Mary,
>
> Put (r'^r/', include('django.conf.urls.shor
Hi Mary,Put (r'^r/', include('django.conf.urls.shortcut')), in your URLConf.On 3/2/06, Mary Adel
<[EMAIL PROTECTED]> wrote:i created my website using flatpages and they are amazing for me and i
am very happy for that but their is a button on the page on the righthand
i created my website using flatpages and they are amazing for me and i
am very happy for that but their is a button on the page on the right
hand side called (view on site) and when i clicked on it it gave me
error says page not found what should i do to make this button work
Thanks,
Mary
28 matches
Mail list logo