I think i've got it. Instead of putting this logic in a custom view I
should just override the change_view method of my custom ModelAdmin.
On Jul 6, 1:46 pm, Jan Rademaker <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm in the process of converting an app to nfa. In this app
Hello,
I'm in the process of converting an app to nfa. In this app some
models have their own change view. Some of these views fall-back to
using the standard amin view based on some condition; like this:
from django.contrib.admin.views.main import change_stage
def my_view(request, model_id):
It does work, make sure you're not logged in.
$ lynx -source -dump
http://localhost:8000/admin/%22%3E%3Cscript%3Ealert%283939%29%3C/script%3E/
| grep alert
alert(3939)/" method="post"
id="login-form">
On May 7, 9:10 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On Wed, May 7, 2008 at 1:45 P
On Dec 21, 5:46 pm, newDjangoer <[EMAIL PROTECTED]> wrote:
> I am experiencing an error when I try to run the following:
>
> >>> from django.db import connection
>
> Traceback (most recent call last):
> File "", line 1, in
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> pyt
newDjangoer wrote:
> I am installing pysqlite 2.4.0. I have python 2.3.5 installed and
> sqlite 3.1.3. When I run the python setup.py build I get this :
>
> skcompxp:~/Desktop/pysqlite-2.4.0 sptxk$ python setup.py build
> running build
> running build_py
> running build_ext
> building 'pysqlite2
On Dec 20, 1:41 am, Gloria W <[EMAIL PROTECTED]> wrote:
> I am boggled. A SELECT from the MySql command line works just fine.
> But within Django, it returns nothing. It doesn't matter what SQL
> statement I issue.
>
> Here is my syntax:
>
> from django.db import connection
> cursor = connect
On Dec 20, 1:41 am, Gloria W <[EMAIL PROTECTED]> wrote:
> I am boggled. A SELECT from the MySql command line works just fine.
> But within Django, it returns nothing. It doesn't matter what SQL
> statement I issue.
>
> Here is my syntax:
>
> from django.db import connection
> cursor = connect
On Dec 19, 8:57 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hello Ben,
>
> I'm not really sure what you mean by leave the _id out.
> What i did with the sponsor_id and method_id was getting the correct
> objects from the Method and Sponsor class
>
He means there is no reason the append
On Dec 19, 6:52 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Thanks.. that's close, but I can't seem to get it to work properly
> from within Django;
>
> They give an example like this:
> def MakeExample1() :
> doc = Document()
> ss = doc.StyleSheet
> sec
On Dec 19, 3:16 pm, Bram - Smartelectronix <[EMAIL PROTECTED]>
wrote:
> hello everyone,
>
> A)
> if you render a DateField it renders as: /MM/DD and then you have to
> tell the user he should use the input_format ( which is MM/DD/ by
> default) which is kind of duh! :)
I wrote some
On Dec 18, 8:12 pm, Bram - Smartelectronix <[EMAIL PROTECTED]>
wrote:
> Hello everyone,
>
> trying to upgrade to the latest trunk, I'm wrestling a bit with the
> autoescape function. Talking about embed-code for an enduser, I used to
> write:
>
> {% include embedded_player.html %}
> Copy-paste t
On Dec 18, 7:14 pm, shabda <[EMAIL PROTECTED]> wrote:
> I am trying to get a value from request.POST. After form submit,
> request.POST contains the values of the ids from the checkbox
> selected. I want the list of those ids. SO I am doing something like,
> entry_ids = request.POST['delete'] ,
> If that does not get you any further, could you paste your complete
> model on dpaste.com?
Never mind dpaste, just post to this group.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post t
dented right, e.g. did you mix spaces and
tabs? Did you try to raise an exception in the method? A simple
`assert False` before `return self.id` should do.
If that does not get you any further, could you paste your complete
model on dpaste.com?
Regards,
Jan Rademaker
--~--~-~--~~---
On Dec 13, 5:18 pm, Kent Johnson <[EMAIL PROTECTED]> wrote:
> Is there a way to express != in a database query?
>
> or mayby
>filter(s1=1, !Q(s2=1))
> but I don't see any way to do this in the docs. Hopefully I am just
> overlooking something!
There is an undocumented class called QNot w
aaloy wrote:
> I'm trying to make a dynamic lookup filter depending on the parameters
> that the user inputs on a web search.
>
> That is, I have three optional search fields and I wan't to be able to
> make a lookup search on my database withot having to code all the
> search options. Something l
No need for Apache, you can put this in your urlpatterns:
('^$', 'django.views.generic.simple.redirect_to', {'url' : '/home/'}),
-janr
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
Glenn,
The 'archive_day' you see in urlpatterns is the name of the view, eg.
django.views.generic.date_based.archive_day and not some string that's
appended to the module's name. The default template names for date
based views happen to be the same as the name of the corresponding
view. The defa
Panos Laganakos wrote:
> Hello,
>
> I am using a local server for all web development stuff. So I set up
> django on it and started the tutorial.
>
> Thing is, that when I try '$ python manage runserver 10.0.0.3:8000' to
> start the server, it won't make it available to the network.
You could tr
hugo wrote:
> >Are you sure? Because now it throws a NameError exception.
> >global name 'gettext_lazy' is not defined
>
> Yes, I am sure. I wrote that stuff ;-)
>
I'm convinced.
> >>> from django.utils.translation import gettext_lazy, activate
> >>> activate('de-de')
> >>> print gettext_lazy('Us
Are you sure? Because now it throws a NameError exception.
global name 'gettext_lazy' is not defined
I must say I'm rather new to Python and haven't got the faintest idea
where to look when I get exceptions like this thrown at me.
This is what I import at the top of my model:
from django.core
The documentation states:
"It doesn't matter which model gets the ManyToManyField, but you only
need it in one of the models -- not in both."
See this example:
http://www.djangoproject.com/documentation/models/many_to_many/
So how come the article objects in this example don't have a
get_publica
Is it possible to use gettext_lazy in a model's __repr__ while using
the objects from a python shell (started with 'manage.py shell')?
When I try to do so I get the following error:
Traceback (most recent call last):
File "", line 1, in ?
File
"/var/home/j.rademaker/django/myproject/../mypro
A bit of code would have clarified my problem. This is what I tried the
first time:
return "Testing %s %s %.2f" % (self.someForeignKey.someThing(),
self.somedate.strftime("%d-%m-%Y"), self.someFloat)
There were 2 problems, basically. First, I tried to access an object
instance directly and not t
What is save to use __repr__ ?
I've found out that I shoud use self.get_someForeignKey().someThing()
instead of self.someForeignKey.someThing(), but what about date fields
and such?
Because, when I use self.someDateField in __repr__ django crashes the
moment _add_ a new object (using admin).
Th
Hello,
As far is I know it's not possible to query date fields for a cerain
week number, eg.
# Select all polls from week 5, 2006
polls.get_list(
pub_date__year=2006,
pub_date__week=5
)
Would it make sense to implement such a thing? An alternative would be
to figure out at what date a w
26 matches
Mail list logo