from Model file
...
class A(models.Model):
B = models.AutoField(primary_key=True)
C = models.CharField(max_length=5)
D = models.CharField(blank=True, max_length=255)
def __unicode__(self):
return unicode( self.Description )
Friendly Driver In Bali
Made Arsana helped to make trip to Bali absolutely amazing. Has a
detailed knowledge of the entire island, allowing Made to help
costumer decide what to see each day and to take alternate routes to
and from each place so that costumer could see even more of the
country. A
Hi,
I am using newforms-admin. Is it possible to define a new field, and
use that
custom field in the "fieldsets tuple?
I tried it, and if I don't have fieldsets defined in my model, then
the custom
model shows. But once I define it, it complains, saying that custom
field
not defined in form.
I got tired of typing "from blabla import *", so here's a 5-line patch that
executes settings.SHELL_STARTUP (defaults to the empty string) in the shell
namespace before interacting.
Enjoy,
Ben
--~--~-~--~~~---~--~~
You received this message because you are
How about recent_authors = Author.object.filter(book__pk__in=[b.pk for
b in recent_books]).distinct()
That can probably be done without the list comprehension but this
should work.
On Mar 24, 7:23 pm, davenaff <[EMAIL PROTECTED]> wrote:
> This seems like something that should be doable, but I
This seems like something that should be doable, but I can't seem to
make it work.
Consider an example with these models:
class Book(models.Model):
author = models.ForeignKey(Author)
publisher = models.ForeignKey(Publisher)
pub_date = models.DateTimeField()
is_hardcover =
>From PyCon,
They said the reason they aren't releasing .97+ is because of all the
backwards incompatible changes. It would make sense that such large
changesets as there are between .96 and trunk would denote a major version
change.
-justin
On Mon, Mar 24, 2008 at 7:37 PM, Michael <[EMAIL
You need to send initial values to the form when you define the form
in its view.
For example, this call would intialize the form with your data:
form = myform(initial={'company':myprofileinfo.company,
'gender':myprofileinfo.gender,})
where 'company' and 'gender' correspond to the names of
Hi Francisco;
By all clues I have heard from the Django devs they are working hard
at getting a full 1.0 release. There are still two major branches that
need to be merged in with the trunk, QuerySet Refactoring and then
Newforms-admin. Then, due to the stringent requirements of the core
devs,
I've been using this more or less this approach:
PYTHON:
t = loader.get_template('posts.html')
html = t.render(Context({ 'tweets' : tweets }))
data = { 'html': html, 'tweet_count': len(tweets) }
json = simplejson.dumps(data)
return HttpResponse(json, mimetype = 'application/javascript')
Hello
How do you handle situations like this one:
http://img209.imageshack.us/img209/9596/a1se8.jpg
When you have a grid of input fields, and every one can generate
error, and, of course, you don't wanna more than one row of errors in
your table. If I check conditions directly in template, I
Hopefully this will help someone else.
# I changed this
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE settings
PythonDebug On
PythonPath "['E:/htdocs/testproject'] + sys.path"
# Into the text below and then it worked
OK made it a bit farther. After all that I restarted Apache.
Then refreshed my URL
http://someserver:8080/testproject
And I get the error ..
ImportError at /testproject/
No module named testproject.urls
Request Method: GET
Request URL: http://someserver:8080/testproject/
Exception Type:
Hi,
I am a newbie learning Django, using newforms, yet I am coming across
many gotchas because I am using 0.97-pre. As I move forward into
creating a couple of applications, I end up looking and looking again
and again because some thing new is assumed by the long time Django
users/developers. I
I'm trying to get Django working on Windows with Apache and MS SQL
Server.
I have completed.
1) Install Apache
2) Install Python 2.5
3) Install mod_python and configure
4) Install Django
5) Setup test project
-- here I learn my Python install is going to need a
-- few more things If I'm going to
Yeah for more flexibility Slicehost or any VPS would be a better option, but
like the others said if something breaks you gotta fix it.
However, if you do decide to go with a VPS, you can just send me an email,
and I'd be happy to set it up and maintain it for you ;)
On Mon, Mar 24, 2008 at 2:09
Hi,
I am starting a simple web app that can be introduced as a collection
of Agendas (represented as Django models).
Each Agenda is composed of Appointments (at least one), and each
Appointment records 0 or more Invitees.
Basically, I would like to display the content of this Agenda on a
page,
On Monday 24 Mar 2008, Evert Rol wrote:
> On 24 Mar 2008, at 19:29 , Tim Sawyer wrote:
> >> The second thing to do is to read the template documentation to see
> >> what is available, because doing so will turn up things like this:
> >>
> >>
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Online registration ends for PostgreSQL Conference East on March 26th
at 5:00pm PST. PostgreSQL Conference: East is being held at the
Univerisity of Maryland, College Park in the CSIC building.
The conference series is designed to be a
On 2008-03-24, at 1312, Tim Sawyer wrote:
>
> Hi Folks,
>
> I want to do this:
>
>
>
>{% for image in Images %}
>
>{{ image.name }}
>{{ image.comment }}
>
> {% if forloop.counter % 4 %}
>
>
> {% endif %}
>{% endfor %}
>
>
>
>
On 24 Mar 2008, at 19:29 , Tim Sawyer wrote:
>> The second thing to do is to read the template documentation to see
>> what is available, because doing so will turn up things like this:
>>
>> http://www.djangoproject.com/documentation/templates/#divisibleby
>
> I saw that, but I couldn't work
honestly i think forloop.counter is what you need to use.
when you say it doesn't work, what do you mean? you do realize this
variable starts at '1' not '0' ?
2008/3/24, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
>
> This seems to work fine for me: http://dpaste.com/41059/
>
> On Mar 24, 2:29
This seems to work fine for me: http://dpaste.com/41059/
On Mar 24, 2:29 pm, Tim Sawyer <[EMAIL PROTECTED]> wrote:
> On Monday 24 Mar 2008, James Bennett wrote:
>
> > The first thing to do is to step back and remember that the Django
> > template language is not Python
>
> I know that - writing
On Monday 24 Mar 2008, James Bennett wrote:
> The first thing to do is to step back and remember that the Django
> template language is not Python
I know that - writing it as python code was the quickest way to get across
what I wanted! :-)
> The second thing to do is to read the template
On Mon, Mar 24, 2008 at 2:12 PM, Tim Sawyer <[EMAIL PROTECTED]> wrote:
> Unfortunately, I can't do the mod (%) in the if statement, as it's not valid
> syntax. Is there a way around this, or a simpler solution?
The first thing to do is to step back and remember that the Django
template
Can you simulate it with an incremental variable?
2008/3/24, Tim Sawyer <[EMAIL PROTECTED]>:
>
>
> Hi Folks,
>
> I want to do this:
>
>
>
> {% for image in Images %}
>
> {{ image.name }}
> {{ image.comment }}
>
> {% if forloop.counter % 4 %}
>
Hi Folks,
I want to do this:
{% for image in Images %}
{{ image.name }}
{{ image.comment }}
{% if forloop.counter % 4 %}
{% endif %}
{% endfor %}
which should hopefully give me a gallery of images where each line has
On Mon, 2008-03-24 at 11:38 -0700, shabda wrote:
> Ah, but practicality beats purity :)
>
> But of course I have not fully profiled, the times so might be not
> select_related as default is a good idea.
I think you're also equating your particular use-cases with being the
most common and
Ah, but practicality beats purity :)
But of course I have not fully profiled, the times so might be not
select_related as default is a good idea.
On Mar 24, 5:40 pm, "Tom Badran" <[EMAIL PROTECTED]> wrote:
> On Mon, Mar 24, 2008 at 11:03 AM, shabda <[EMAIL PROTECTED]> wrote:
>
> > In most of my
>Lots more flexibility, but when things break its your fault.
Well at least you're able to rebuild instead of begging customer
service to do it for you. I'll definitely submit my +1 for Slicehost.
-Bryan
--~--~-~--~~~---~--~~
You received this message because you
Hi folks,
I'm quite new to django and I see that I should be using newforms. But
how about the whole lot of useful and FREE validators in django.core?
I wish to use the built-in validators with newforms and don't want to
reinvent the wheel/duplicate the code. Is there a recommended way to
do
Hi,
I'm developing a django site and I need your suggestions about the
topic.
Actually, I'm not sure where to start but basically, I want to make
something like;
(I have an account on a site which requires log-in)
- My server will be logged-in to that site with my account.
- And when a user
Hello Chris,
On Sat, Mar 22, 2008 at 04:07:38PM +, Chris Hoeppner wrote:
> > I use autoconf for that. The template file, settings.py.in, contains
> > statements like this:
>
> > DATABASE_NAME = '@binpkg@'
> > MEDIA_ROOT = @datadir@ + '/images'
> >
> > To generate settings.py, I use a
I do use them and I'm a fan. If you're looking for something more full
featured, I also use slicehost for client work. Lots more flexibility, but
when things break its your fault.
-justin
On Mon, Mar 24, 2008 at 1:13 PM, Julian DeFronzo <[EMAIL PROTECTED]>
wrote:
> webfaction.com, has great
webfaction.com, has great reviews. But I personally don't use them.
On Mon, Mar 24, 2008 at 1:11 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:
>
> Anyone kows a good and cheep django hosting service website?
>
> Thanks.
> >
>
--
~Julian D.
Anyone kows a good and cheep django hosting service website?
Thanks.
--~--~-~--~~~---~--~~
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
Great viedeo!!
http://rozrywka.yeba.pl/show.php?id=1081
--~--~-~--~~~---~--~~
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
Thanks Michael for you sugestions, I'll look into that!
Michael schrieb:
Now I am curious if there is also a build-in functionality that objects
become serialized into json by automatically calling a __json__ function
on the object??
When looking at the docs simplejson throws an
On Mon, 2008-03-24 at 07:02 -0700, Valery wrote:
> Hi all,
>
> i got django 0.95.1 (the one currently available under Ubuntu Feisty).
> I fail to convince Django to accept my aggregated "GROUP BY" database
> views as they have no primary key and, surely, Django also can't
> create this pk for
Hi all,
i got django 0.95.1 (the one currently available under Ubuntu Feisty).
I fail to convince Django to accept my aggregated "GROUP BY" database
views as they have no primary key and, surely, Django also can't
create this pk for me in a view :)
the situation with aggregated data views in
For just running another python script from within python, there's a
number of options:
+ the exec statement: >>> help('exec')
+ the execfile() function (deprecated in py3k)
+ the imp module
On 3/24/08, Chris Hoeppner <[EMAIL PROTECTED]> wrote:
>
> Just thinking about this...
>
> Is there
On Mon, Mar 24, 2008 at 6:19 AM, Julien <[EMAIL PROTECTED]> wrote:
> I would like to do something like:
>
> def called(arg)
> if arg==True:
> !!magic!!caller.return 1
>
> def caller(arg)
> called(arg)
> return 2
>
"called" look like a precondition constrain[1], then It
Just thinking about this...
Is there really no way to import something not being on the pythonpath?
Maybe importing the file's contents as string and stuff it through some
parser function (just ranting here, don't even know if there is such a
thing)?
What I want is make a few files execute in a
On Mon, Mar 24, 2008 at 11:03 AM, shabda <[EMAIL PROTECTED]> wrote:
>
> In most of my pages, select_related dramatically reduces the number of
> queries the page is needing, so I was wondering what is the reason
> behind not making select_related default and providing a method for
>
Oh, I forgot to say. For while I thought I'd make hijacker a
decorator:
@hijacker
def my_view(request):
But that wouldn't work, since some views need to do some processing
before calling the hijacker. I think a decorator is systematically
called before the view itself so no prior
In fact, what I want is to hijack a view:
def hijacker(request):
if I_feel_its_necessary:
hijack_caller_view_and_return(some_json_content)
def my_view(request):
hijacker(request)
... # Continue as normal
return some_html_content
I have some long views which I'd like to
Version 0.1.1 of Evoque is now available.
This is mostly a bug-fix release. See complete change log from:
http://evoque.gizmojo.org/download/
Other than fixes, it may be worthwhile to mention the addition of a
recipe for using Evoque Templating with Django, see:
hi
This is my new website... Please see the website... It is very useful
for u..
http://fouziya.notlong.com
with luv,
Fouziya
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
I don't know how to do this in Python, if you even can. Inspect may be
just the dark scary corner to explore to find this capability if it
exists. But why would you want to do something like this? Even if
inspect could do this, it looks like called would have to have some very
specific
> We seem to be turning into comp.lang.python here. :-(
Good point, I'll try my chance over there.
> Sounds like you want to use an exception and have caller catch an
> exception of a particular type and then return the value in the
> exception object.
In fact, I don't want 'called' to throw
For the record, you could also have got it to work, as from memory
suggested elsewhere in mod_python mailing list archives, by adding
appropriate:
-Wl,-F/usr/local/python-3.0a3/frameworks
like option into mod_python makefiles at appropriate spot. Using
appropriate path of course as mod_python
In most of my pages, select_related dramatically reduces the number of
queries the page is needing, so I was wondering what is the reason
behind not making select_related default and providing a method for
do_not_select_related
--~--~-~--~~~---~--~~
You received
> This is more a Python issue than a Django one, but I thought the
> Python-aware people that you are might be able to help me :)
>
> I would like to do something like:
>
> def called(arg)
>if arg==True:
>!!magic!!caller.return 1
>
> def caller(arg)
>called(arg)
>return 2
>
>
I have used html2pdf in the past and it is awfully easy! In one of my
apps, I had a requirement that each page be also available as pdf.
so
def view_func(self):
..normal processing
if request.GET.has_key('pdf'):
#Get the pdf template
html =
On Mon, 2008-03-24 at 03:19 -0700, Julien wrote:
> Hi all,
>
> This is more a Python issue than a Django one, but I thought the
> Python-aware people that you are might be able to help me :)
>
> I would like to do something like:
>
> def called(arg)
> if arg==True:
>
I had trouble building mod-pyhon 3.3.1 on Mac OS X 10.5.2 (Leopard),
so I thought I would share the solution here. I posted this yesterday
to the mod_python mailing list and I incorporated the suggestion I
received from there below.
I have installed Python 2.5.2 into /usr/local (to use
Hi all,
It looks like this problem has been fixed in the past but I have been
having it crop up recently.
Here is what I did:
1. created an app
2. manually entered some data
3. took a fixture dump of the app
4. dropped and created a new database
5. restored the fixture dump
6. Whenever I tried
I had a similar problem here and I solved it by using a specific flag
for ajax queries + a context processor to mirror the value of the flag
in the template context.
In my base template I have a big {%if flag %} so all the logo, menus
and whatnot don't get rendered for ajax queries. But if you
Hi all,
This is more a Python issue than a Django one, but I thought the
Python-aware people that you are might be able to help me :)
I would like to do something like:
def called(arg)
if arg==True:
!!magic!!caller.return 1
def caller(arg)
called(arg)
return 2
Here, the
Hey,
pkg_resources throws an ImportError (I'm googling it up as I type), and
as for eggs, I really never got my head around them, useful as they
might seem.
I might probably just go down the easy way and have the things I want to
import on the pythonpath (maybe even add the paths "dynamically"
Hey, friends
Can someone tell me how to get the input file value when i upload
file? I want to record all the file detail path from client, and
i have try print all the post messages, but it seems no messages about
the client file path.
And i try using , then i can get the text value
from
On Mar 24, 5:29 pm, Peter Rowell <[EMAIL PROTECTED]> wrote:
> > He's running a site on vBulletin, so his PHP needs to stay, is there
> > any issues I should be careful of not upset the PHP, while still
> > getting Django and mod_python correctly installed on the server?
>
> The one thing I am
> He's running a site on vBulletin, so his PHP needs to stay, is there
> any issues I should be careful of not upset the PHP, while still
> getting Django and mod_python correctly installed on the server?
The one thing I am aware of is that under certain circumstances there
can be a problem
63 matches
Mail list logo