I want to use pychecker to do static analysis on my code. So I set up
DJAGO_SETTINGS_MODULE and run pychecker from shell. I am getting
exceptions like,
G:\prajact>pychecker project\urls.py
G:\prajact>C:\Python24\python.exe C:\Python24\Lib\site-packages
\pychecker\checker.py project\urls.py
I think we'd need to see your Event model class too. It really would
be a good idea to take advantage of the validation from doing this as
a django form, just passing in POST is dangerous. It would also
abstract the whole datetime handling issue for you.
>(the save() method shouldn't raise
>any validation errors except those triggered by the database server due
>to IntegrityErrors).
So what is the recommended place to write validations in models, for
now?
On Feb 22, 12:25 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Thu, 2008-02-21 at
If you use old forms.. you'd just do something like this .. for each
of the attributes you want to search on.
class MyManipulator(forms.Manipulator):
def __init__(self):
sizes = []
all_sizes = Size.objects.all()
if all_sizes:
sizes = [(obj.name, obj.name)
On Fri, Feb 22, 2008 at 12:07 PM, Malcolm Tredinnick
<[EMAIL PROTECTED]> wrote:
>
> On Thu, 2008-02-21 at 18:58 -0800, msoulier wrote:
> > Hi,
> >
> > I'm loading a fixture with 2500 objects in it into postgres 7.4.
> >
> > For some reason, loaddata is looking in a lot of additional places
I recently found that snippet, which you could use to assign a
temporary variable in your template: http://www.djangosnippets.org/snippets/539/
In theory, it's bad practice, but so useful in some situation ;)
On Feb 22, 1:13 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Thu, 2008-02-21
On Thu, 2008-02-21 at 18:58 -0800, msoulier wrote:
> Hi,
>
> I'm loading a fixture with 2500 objects in it into postgres 7.4.
>
> For some reason, loaddata is looking in a lot of additional places
> than the file I'm handing it.
>
> [EMAIL PROTECTED] teleworker]# PYTHONPATH=.. python
Hi,
I'm loading a fixture with 2500 objects in it into postgres 7.4.
For some reason, loaddata is looking in a lot of additional places
than the file I'm handing it.
[EMAIL PROTECTED] teleworker]# PYTHONPATH=.. python manage.py
loaddata /root/clients.json
Loading '/root/clients.json'
Malcolm! You rock! I had put a function before every
render_to_response to analyze the queries made by every function and I
still couldn't find it. Your solution went deeper and i found the
strange query being made in the default 500 page rendering! How
bazar. Thanks a ton for your help.
On Thu, 2008-02-21 at 20:47 -0500, Nick Fishman wrote:
> Hey everyone. I've run into an issue with dictionaries in templates, and
> I'm kind of stuck. I'm trying to track incidents by username and month.
> Here's what I have passed into a template:
>
> months = ['Mar', 'Feb', 'Aug', 'Sep',
Hey everyone. I've run into an issue with dictionaries in templates, and
I'm kind of stuck. I'm trying to track incidents by username and month.
Here's what I have passed into a template:
months = ['Mar', 'Feb', 'Aug', 'Sep', 'Apr', 'Jan', 'May', 'Nov', 'Dec',
'Oct']
mapping = {'username':
On Feb 22, 11:02 am, Richard Jones <[EMAIL PROTECTED]> wrote:
> On Feb 22, 9:54 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
>
> > Or use one of the many other options for serving Django applications
> > (mod_wsgi, cherryPy's server, nginx + fastcgi, lighttpd + fastcgi, ...).
>
> I have
On Feb 22, 9:54 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> Or use one of the many other options for serving Django applications
> (mod_wsgi, cherryPy's server, nginx + fastcgi, lighttpd + fastcgi, ...).
I have compiled and installed the latest mod_wsgi. I'll see how that
goes.
On Thu, Feb 21, 2008 at 5:06 PM, Albert Hopkins <[EMAIL PROTECTED]> wrote:
> I have a model with a M2M field and I want to filter based on the field
> being empty. How do I do this? I tried
> MyModel.objects.filter(m2mfield=[]) but that raises a (MySQL) exception.
Is this what you want?
I have a model with a M2M field and I want to filter based on the field
being empty. How do I do this? I tried
MyModel.objects.filter(m2mfield=[]) but that raises a (MySQL) exception.
-a
--~--~-~--~~~---~--~~
You received this message because you are
On Thu, 2008-02-21 at 14:48 -0800, Richard Jones wrote:
> On Feb 12, 11:03 am, Richard Jones <[EMAIL PROTECTED]> wrote:
> > On Feb 9, 5:19 pm, Richard Jones <[EMAIL PROTECTED]> wrote:
> >
> > > I'm still getting thetransienterrors mentioned in my OP though.
> >
> > Anyone? I'd be happy to
On Feb 12, 11:03 am, Richard Jones <[EMAIL PROTECTED]> wrote:
> On Feb 9, 5:19 pm, Richard Jones <[EMAIL PROTECTED]> wrote:
>
> > I'm still getting thetransienterrors mentioned in my OP though.
>
> Anyone? I'd be happy to provide more detail if there was any that
> might help?
Still getting
On Feb 21, 2:37 am, Richard Dahl <[EMAIL PROTECTED]> wrote:
> If you are using Apache or other web server on the external site,
> changes will not propagate until you restart the web server.
Depending on the web server hosting solution you may not have to
restart the web server. If using
Hello,
We have an opportunity to switch over from Java to something easier
for a series of sites that we will be doing. They will be small
simple sites but with a reasonable amount of traffic so performance
will be important. If this was a database based app I'd go into this
meeting suggesting
Your right, I looked too quickly and saw the for instead of the id.
Thanks for the correction.
On Feb 21, 3:54 pm, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On 21 Feb, 18:57, Little_Grungy <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > I have a form definition for two radio buttons named
I'm not sure I understand what I'm doing here. I'm trying to create an Event
object from the data in a form (a simple html form, not a django form).
I want to do this:
lDay = int(request.POST['DayNo'])
lMonth = int(request.POST['MonthNo'])
lYear = int(request.POST['YearNo'])
On 21 Feb, 18:57, Little_Grungy <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a form definition for two radio buttons named choices. I want
> to loop through the radio buttons to perform a check with javascript
> in the rendered html page, however due to the radio button _id's that
> are rendered
Actually, it looks like I can use a formfield callback. Not sure
exactly how to do it yet, but
they are described in the djangoproject newforms library doc.
On Feb 21, 2:51 pm, Michael Newman <[EMAIL PROTECTED]> wrote:
> not in the views per se, but you can certainly take care of this in
> the
not in the views per se, but you can certainly take care of this in
the templates, just manually define each of the fields.
On Feb 21, 1:23 pm, csmith87 <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Newbie django user
>
> Is it possible to change a newform label (from the one in the model)
> to
Hmm this is interesting because django is rendering out poor html if
your example is correct. IDs in the DOM should be unique. I don't
imagine that this would validate the way you want it to either. Why
not just have 2 form.BooleanField objects and in the def clean make
sure that one is taken
ok, thanks
/me goes in the corner RTFM :-)
--
error: one bad user found in front of screen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
On Thu, 2008-02-21 at 08:54 -0800, shabda wrote:
> I have some models, and some forms to write data to them. The
> attributes in models need to have soem validations, (For example, name
> must be alpha numeric, price must be less that 1000 etc). SO I write
> the validations in model.save() and
On Thu, Feb 21, 2008 at 10:22 AM, shabda <[EMAIL PROTECTED]> wrote:
>
> I have a model like
>
> class Task(models.Model):
> name = Models.CharField(max_length = 100)
> parent = models.ForeignKey('Task', null = True)
>
> Using this model say I have got a table like,
>
> Task
> ---
>
As Karen said, You didn't set up the inline right. Read through the
docs she pointed you to and fix your errors and the big error will go
away.
On Feb 21, 1:31 pm, "Almir Karic" <[EMAIL PROTECTED]> wrote:
> On Thu, Feb 21, 2008 at 3:02 PM, Karen Tracey <[EMAIL PROTECTED]> wrote:
> > On Thu, Feb
That worked great for the base template. But how do I pass database
values to a view in an app?
I have a a view that should have all the records available for a
template so that I can loop through each record and display on the
screen. I cannot figure out how to give the template access to the
That would help once I get the relational data to a hierarchical list,
and that is the difficult part!
On Feb 21, 10:59 pm, Brian Luft <[EMAIL PROTECTED]> wrote:
> http://www.djangoproject.com/documentation/templates/#unordered-list
>
> On Feb 21, 4:22 am, shabda <[EMAIL PROTECTED]> wrote:
>
> >
Hi,
I have a form definition for two radio buttons named choices. I want
to loop through the radio buttons to perform a check with javascript
in the rendered html page, however due to the radio button _id's that
are rendered by the template, I cannot access them with javascript
using
On Thu, Feb 21, 2008 at 3:02 PM, Karen Tracey <[EMAIL PROTECTED]> wrote:
> On Thu, Feb 21, 2008 at 3:55 AM, Almir Karic <[EMAIL PROTECTED]> wrote:
>
> >
> > from django.db import models
> > from django.contrib import admin
> >
> >
> > # Create your models here.
> >
> > class
Hello,
Newbie django user
Is it possible to change a newform label (from the one in the model)
to one
set in the view ? (i.e. I want the tags lefttag, righttag) in the
view below to
appear in the generated form as the label, not the model label.
Thanks in advance ...
Here is my model
Oh, duh, that's so much simpler. (Now I feel like a nitwit.)
Should I be concerned about the performance issues with frequent
selects of that type? The table size is on the order of hundreds of
thousands (not tens of thousands) of rows.
--~--~-~--~~~---~--~~
You
While not exactly Django-specific, I wrote up an article[1] last
month, describing an easy way to enable plugins in any Python
application. I don't know if that's what you're looking for, but it's
probably worth a look, anyway.
-Gul
[1]
On Thu, Feb 21, 2008 at 9:13 AM, Bram - Smartelectronix
<[EMAIL PROTECTED]> wrote:
> I was looking at that before, but... aren't django signals mostly for
> one-sided communication? I.e. I signal something, someone else catches
> it and does something.
>
> In wordpress it's very much 2-sided
http://www.djangoproject.com/documentation/templates/#unordered-list
On Feb 21, 4:22 am, shabda <[EMAIL PROTECTED]> wrote:
> I have a model like
>
> class Task(models.Model):
> name = Models.CharField(max_length = 100)
> parent = models.ForeignKey('Task', null = True)
>
> Using this model
validation meaning python manage.py validate and python manage.py
syncdb. I really don't know what is messing up other than the fact
that module has a circular load. I have no idea to fix this one.
Thanks Evert for your help. Anyone else?
On Feb 21, 12:44 pm, Evert Rol <[EMAIL PROTECTED]> wrote:
> There is a threaded comments app http://code.google.com/p/django-
> threadedcomments/
> , Now that I think about it, they surely would be doing this
> conversion from relational to hierarchical format. I will read the
> code and let you know if I can find something useful.
While I had been
> That would be true if I defined both models in the same models.py, and
> Profile was trying to use Bookmark before it was loaded in the file.
> Because this is an import the quotes won't work. That being said this
> in one model works when I don't need to put a import statement in it.
> So:
>
>
There is a threaded comments app
http://code.google.com/p/django-threadedcomments/
, Now that I think about it, they surely would be doing this
conversion from relational to hierarchical format. I will read the
code and let you know if I can find something useful.
On Feb 20, 7:10 pm, Evert Rol
That would be true if I defined both models in the same models.py, and
Profile was trying to use Bookmark before it was loaded in the file.
Because this is an import the quotes won't work. That being said this
in one model works when I don't need to put a import statement in it.
So:
Dj Gilcrease wrote:
> On Thu, Feb 21, 2008 at 6:23 AM, Bram - Smartelectronix
> <[EMAIL PROTECTED]> wrote:
>> Basically plugins can register with the host app and say "I want to be
>> plugged in here or there" (the hook). The host app in various places has
>> calls which "apply" whatever is
> I have a model like
>
> class Task(models.Model):
> name = Models.CharField(max_length = 100)
> parent = models.ForeignKey('Task', null = True)
>
> Using this model say I have got a table like,
>
> Task
> ---
> ID Name Parent_id
> 1 Foo null
> 2 Bar 1
> 3 Baz1
> 4
On 21 Feb 2008, at 16:44 , Michael Newman wrote:
>
> I am a bit confused as to why it is that this gives me an error. I
> hope someone could explain it to me.
>
> Let's say I have users with Profiles that can be connected to the one
> Web page that they can author. The other Users can bookmark
I have some models, and some forms to write data to them. The
attributes in models need to have soem validations, (For example, name
must be alpha numeric, price must be less that 1000 etc). SO I write
the validations in model.save() and raise Exceptions, when a
validation fails. I also need to
I am a bit confused as to why it is that this gives me an error. I
hope someone could explain it to me.
Let's say I have users with Profiles that can be connected to the one
Web page that they can author. The other Users can bookmark that page.
So my models look like this:
profiles.models.py
It was a cookie issue. I had looked over this... but missed it on
first glance. My apologies
MerMer
On Feb 21, 4:17 pm, merric <[EMAIL PROTECTED]> wrote:
> I've commented out all the HTML on the template, so my template now
> reads as follows
>
> {% for i in prizes %} {{i.id }} {%
I've commented out all the HTML on the template, so my template now
reads as follows
{% for i in prizes %} {{i.id }} {% endfor %}
There is nothing else on the page except the commented out HTML.
In firefox this displays without any problem, in IE7 I get a blank
page, even when looking at
On Thu, Feb 21, 2008 at 9:35 AM, glopglop <[EMAIL PROTECTED]> wrote:
> Not trying to be slow-witted, but couldn't you do
>
> objects = MyModel.unfiltered() if request.user.is_admin else
> MyModel.filtered()
> (where objects is a queryset)
>
> is there a functionnal difference or is it more
On Thu, Feb 21, 2008 at 8:26 AM, merric <[EMAIL PROTECTED]> wrote:
>
> I have a template that uses {% for i in prize %} {{ i.description }}
> {% endfor %}
>
> This iterates fine in Firefox, but in IE7 it keeps coming up blank.
> I can't see any html issues. I am working off my localhost.
> This iterates fine in Firefox, but in IE7 it keeps coming up blank.
> I can't see any html issues. I am working off my localhost. Is this
> a IE7 security issue or something else I have not thought of?
I had a the similar problem once with IE7. It ended up being due to
CSS incompatibility
On 20 fév, 17:07, Michael Elsdörfer <[EMAIL PROTECTED]> wrote:
> > I understand you could also reuse it from model to model, but in my
> > code I have rarely found reusing those methods between different
> > models, except some ways that would generally be better solved with
> > model
Hi Michael,
Thanks a lot. That query made me realize I've got to re-think this.
http://groups.google.com/group/django-users/browse_thread/thread/477915b60c5d160e/ff677bbbf87ea9b3?lnk=gst=django+edit+inline#ff677bbbf87ea9b3
On Feb 21, 8:21 am, Michael Newman <[EMAIL PROTECTED]> wrote:
>
Fine, it's clearer for me now (with the added smart examples).
"The distinguishing factor between manager methods and class or static
methods
should be the database. Managers handle table-wide operations ; Python-
level operations
don't know anything about a database at all."
Maybe a sentence
http://www.djangoproject.com/documentation/model-api/#many-to-one-relationships
look at the edit inline option. The blogosphere is also nice enough to
have posted hundreds of examples and test cases that might meet your
purposes. Google django edit inline for these examples.
On Feb 21, 9:56 am,
If that isn't the issue make sure to look at the source HTML. If it is
rendering the code then there is something wrong with your styles that
IE is hiding your content (Most likely a position:relative float
thing). Or you might want to kick apache, sometimes it loads old
settings. Last thing that
Mateusz,
Even though we corresponded on IRC, I'd like to respond for the
benefit of the community. First, there is no dedicated GeoDjango list
(yet) -- but we do have a dedicated channel on freenode (#geodjango).
There are no Django database backends for Informix and DB2. GeoDjango
requires
I'm trying to work out how I'm going to setup a model structure a
video section of my website. Say I have this scenario.
- Each video belongs to a set of 4-5 videos.
- Depending on the set the video belongs too, certain information will
need to be attached to that video (ie> recipe/chef
Malcom is right, this has absolutely nothing to do with the {% for %}
tag.
My guess is that your IE7 might be more restrictive on cookies and not
allowing the server to create a session cookie.
If your view code assumes that there is a session and you fetch
"prize" from the session, then
On Thu, Feb 21, 2008 at 6:23 AM, Bram - Smartelectronix
<[EMAIL PROTECTED]> wrote:
> Basically plugins can register with the host app and say "I want to be
> plugged in here or there" (the hook). The host app in various places has
> calls which "apply" whatever is hooked into that location.
>
hey guys,
I've been asked to write a wordpress-like system in django, with hooks
and action-hooks for plugin-creation alla wordpress.
Now the question is - how would you guys handle this? I was thinking
that hooks could be represented by template tags which pass the context
to whatever
On Thu, Feb 21, 2008 at 3:55 AM, Almir Karic <[EMAIL PROTECTED]> wrote:
>
> from django.db import models
> from django.contrib import admin
>
>
> # Create your models here.
>
> class Category(models.Model):
>name = models.CharField(max_length=50)
>
>def __str__(self):
>
Do you like milk coffe ?
http://www.mediaportal.ro/play.php?pid=6560%20cu%20lapte!%20natural(a)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Thanks Ned, I had misunderstood the concept of "file-like" and you've
explained it admirably, exactly what I needed to know. Though
Malcolm's tip regarding the unsuitability of HttpResponse as a
flotation device will be a life-saver for many, I'm sure.
This is what works for me:
import
On Thu, 2008-02-21 at 05:26 -0800, merric wrote:
> I have a template that uses {% for i in prize %} {{ i.description }}
> {% endfor %}
>
> This iterates fine in Firefox, but in IE7 it keeps coming up blank.
> I can't see any html issues. I am working off my localhost. Is this
> a IE7
I have a template that uses {% for i in prize %} {{ i.description }}
{% endfor %}
This iterates fine in Firefox, but in IE7 it keeps coming up blank.
I can't see any html issues. I am working off my localhost. Is this
a IE7 security issue or something else I have not thought of?
Cheers
:O
Well that was stupid of me... I think I assumed it worked since the
testing server worked. :P
Thanks! All fixed
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
In Python, there is a loose concept of a "file-like" object. This means
that the object behaves like a file under duck-typing, meaning it has
the right methods to be treated just as if it were a file. But the
concept is only loosely defined, and different file-like objects
implement
I have a model like
class Task(models.Model):
name = Models.CharField(max_length = 100)
parent = models.ForeignKey('Task', null = True)
Using this model say I have got a table like,
Task
---
ID Name Parent_id
1 Foo null
2 Bar 1
3 Baz1
4 Bax2
I want to
I didn't understand the docs. Apologies to those who do.
On Feb 19, 11:23 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2008-02-19 at 14:35 -0800, itpaul wrote:
>
> [...]
>
> > this also means that the documentation
> > (http://www.djangoproject.com/documentation/templates/#cycle
On Thu, 2008-02-21 at 03:41 -0800, kip wrote:
> I thought I would be able to use an HttpResponse object as the file
> argument for ZipFile, like this:
>
> response = HttpResponse(mimetype='application/zip')
> response['Content-Disposition'] = 'attachment; filename=zipfile.zip'
> file =
Thanks Brian
On Feb 20, 9:03 pm, Brian Morton <[EMAIL PROTECTED]> wrote:
> By default, Django assumes that the SMTP server is running locally.
> If you don't have one running locally, you need to set EMAIL_HOST and
> EMAIL_PORT in your settings.py file to a valid SMTP server.
>
> On Feb 20,
I thought I would be able to use an HttpResponse object as the file
argument for ZipFile, like this:
response = HttpResponse(mimetype='application/zip')
response['Content-Disposition'] = 'attachment; filename=zipfile.zip'
file = zipfile.ZipFile(response, "w")
but as soon as I try to write to it
On Thu, 2008-02-21 at 00:37 -0800, Dave Fowler wrote:
> I have a phantom query that is just killing my database. I have a
> model named Stats and django is executing the equivalent to
> Link.objects.all() in my Stats app.
>
> # Query_time: 20 Lock_time: 0 Rows_sent: 659528 Rows_examined:
Thanks Malcolm, I'd over-egged the html pudding
Regards,
Eamon Carron
On Feb 20, 5:18 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Wed, 2008-02-20 at 05:28 -0800,Eamonwrote:
> > Hi All,
>
> > I am a newbie and I can't seem to get my checkbox code working using
> > newforms.
>
> >
See the changes listed here:
http://code.google.com/p/django-tagging/wiki/BackwardsIncompatibleChanges
you may be able to give directly the queryset rather than the model
On Thu, Feb 21, 2008 at 1:25 AM, cesco <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm using the latest version of the django
Hi,
> Any chance you were using django-tagging previously and recently
> updated to trunk? There are backwards incompatible changes - the
> relation names have
> changed:http://code.google.com/p/django-tagging/wiki/BackwardsIncompatibleCha...
I was actually getting the same error before and
Hi
> So the SQL that is being constructed by the joined queryset isn't valid.
> I'm almost certain the answer to this is "it's fixed in
> queryset-refactor, so will one day be fixed in trunk."
Thanks for the work you are doing:-)
> Pull the results back into Python and merge them manually.
I have a dedicated macmini for around 75 euro's a month, At
cqhosting.nl.
On Feb 18, 12:12 am, Flavio Curella <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I developed a small application using django and CoreGraphics library
> as a school project. I'm wondering to put it online and I googled
> around
thanks!
a subclass of newforms.BaseForm did the job!
lowshoe
On Feb 20, 11:35 pm, presclark <[EMAIL PROTECTED]> wrote:
> Hello, I was having a similar, but slightly different problem.
>
> My hangup was that the form_change form wasn't being populated. It
> seems that the optional 'form'
from django.db import models
from django.contrib import admin
# Create your models here.
class Category(models.Model):
name = models.CharField(max_length=50)
def __str__(self):
return self.name
class Forum(models.Model):
cat =
If it's for school project, and you just need to demo it, why not
host it on your own machine and use one of the free dynamic DNS
services and host it on the development machine?
--Jon
> > On Feb 17, 2008 3:12 PM, Flavio Curella <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi,
> > >
> > >
yes, i've taken them all out, even the ones that shouldn't have gotten close
to my stats_link table
2008/2/21 Jarek Zgoda <[EMAIL PROTECTED]>:
>
> Dave Fowler napisał(a):
>
> > I have a phantom query that is just killing my database. I have a
> > model named Stats and django is executing the
Dave Fowler napisał(a):
> I have a phantom query that is just killing my database. I have a
> model named Stats and django is executing the equivalent to
> Link.objects.all() in my Stats app.
>
> # Query_time: 20 Lock_time: 0 Rows_sent: 659528 Rows_examined: 659528
> SELECT
>
I have a phantom query that is just killing my database. I have a
model named Stats and django is executing the equivalent to
Link.objects.all() in my Stats app.
# Query_time: 20 Lock_time: 0 Rows_sent: 659528 Rows_examined: 659528
SELECT
87 matches
Mail list logo