Ordering:
qs = Model.objects.filter(...).order_by('ordering_field')
ord_list = [el for el in qs]
Versioning:
code.google.com/p/django-rcsfield
(There are a few others, cant remember the names offhand.)
On Oct 21, 12:13 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> On 21 oct, 08:37, Dan
I need to use DynamicForm(form generated using database values), so I
am using this method,
http://uswaretech.com/blog/2008/10/dynamic-forms-with-django/
Now the order in which I define the fields is not the same as that for
the rendered Html. If I change the line like setattr(EmployeeForm,
fiel
You want something like this
@models.permalink
def get_absolute_url(self):
return ('orgs.views.org', [self.type.slug, self.slug])
Essentially, you code would be doing something like reverse('/org/
hoa/', kwargs={..}) which fails. Templates supress Exceptions so you
do not see them.
On Oct
I have some forms.Fields, which are not attached to any forms.Form.
How can I get the Html representation of it?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
I need to create a custom filter which displays some data from db
depending on its data type.
My code is something like,
from django.template.defaultfilters import linebreaks, urlize
def filterxx(data)
return linebreaks(urlize(data.value))
My data.value is
Asdfghjkl
alert('hole')
This
So if these built in filters are marking my strings safe, inspite of
unsafe data being passed in, should they not handle escaping as well?
Rajesh Dhawan wrote:
> On Oct 29, 8:35 am, shabda <[EMAIL PROTECTED]> wrote:
> > I need to create a custom filter which displays so
I have an Admin site which I want to filter based on request.user.
My ModelAdmin class is something like this,
class FilterOnUser(admin.ModelAdmin):
def queryset(self, request):
return self.model._default_manager.filter(user = request.user)
def get_form(self, request, obj=None,
I want to write some test for my middleware seperate from the views
that would be using them. So I am using this snippet
http://www.djangosnippets.org/snippets/963/ to get a request, and
calling my middleware with it to test it, but it looks a little
hackish to me. Is there a better way?
--~--~---
Is there a place where I can get the app completed as part of
http://docs.djangoproject.com/en/dev/intro/tutorial04/#intro-tutorial04
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to th
Django registration has moved from googlecode to Bitbucket, which
means my projects which are svn:externaled to django-registration
might not get the latest code. Is anyone maintaining an svn repository
which is I can svn:external to?
--~--~-~--~~~---~--~~
You recei
]: shabda = Foo(name = 'Shabda')
In [3]: shabda.save()
In [4]: Foo.objects.all()
Out[4]: []
In [5]: shabda.name = 'Shabda Raaj'
In [6]: shabda.save()
In [7]: Foo.objects.all()
Out[7]: [, ]
Which is what I expect. Now doing the same thing to Bar
In [1]: from djcalendar.m
One of my views is returning a Http404, and I think it is calling a
view function diffrent from what I am expecting to be called.
So How can I check which view is being called in response to a
specific Url?
--~--~-~--~~~---~--~~
You received this message because yo
> so I would expect more problems
>
> On Oct 12, 9:16 am, shabda <[EMAIL PROTECTED]> wrote:
>
> > My models.py
>
> > class Foo(models.Model):
> > name = models.CharField(max_length = 100)
>
> > def save(self):
> > self.i
ts.count()
Out[5]: 1
In [6]: y=SubSingleton(name='a', tag='b')
In [7]: y.save()
---
AttributeErrorTraceback (most recent call
last)
/home/shabda/django_design_pats/ in ()
/home/sh
[Trying not be trollish, but the subject might be so. My apologies in
advance.]
I run a small Django development firm ( www.uswaretech.com ), and a
lot of clients we go after need to be convinced on why they should
choose Django. What is your experience in this? Specifically am I
looking for is,
oF [1] sessions.
Shabda will let us know the venue of the IRC meeting. In the meantime,
let us decide on a suitable timing for the meeting.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
Hi,
I have a model class like this
class Link(models.Model):
link = models.URLField()
user = models.ForeignKey(User, unique=False)
text = models.TextField(maxlength = 20)
votes = models.IntegerField()
I want some of the fields to have defaults, like I want votes to have
a defaul
ue of ``None``
So providing default values for models should be possible.
On Jun 18, 9:30 pm, shabda <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a model class like this
>
> class Link(models.Model):
> link = models.URLField()
> user = models.ForeignKey(User, unique=F
Hi,
I am prototyping an app. Since I am just prtotyping I do not want to
write templates yet. SO is there some way wherein all my variables in
the view method get out put to the screen, so that I can debug them?
--~--~-~--~~~---~--~~
You received this message bec
Also using locals() and printing is not very useful as it dumps too
much data to screen to be any use.
On Jun 18, 10:04 pm, shabda <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am prototyping an app. Since I am just prtotyping I do not want to
> write templates yet. SO is there some
Hi,
What host do you people recommend for hosting a small-medium traffic
django site. Its just a hobby hobby site so I dont want too costly a
host, but since this is the first django app I would be hosting, I
would prefer a host with reasonable support and one which specialises
in django.
--~--
Hi,
I want to use some stored procedures. I am mySql. Is there some way I
can define stored procedures from withing django?
(We can call already defined procedures,
http://www.djangosnippets.org/snippets/118/
discusses how, but can we also define stored procedures from within
django?)
--~--~--
thanks, That solves my problem.
On Jun 21, 11:05 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> > I want to use some stored procedures. I am mySql. Is there
> > some way I can define stored procedures from withing django?
> > (We can call already defined procedures,
> >http://www.djangosnippets.org/s
I have apache installed on linux with mod_php, mysql. I am trying to
get django working here, and am following the intsallation steps at
http://www.djangobook.com/en/beta/chapter21/ .
Step 1. Install mod_python
did yum install mod_python. Checked that mod_python is installed.
Step 2.
Add this to y
I am trying to setup django with mysql, After installing django and
mysql I am trying to set up mysql-python.
So I give the command
$ easy_install MySQL-python
And am getting a ton of errors.
On the page http://www.djangobook.com/en/beta/chapter02/, under
comments for mysql it says,
"Don't forget
_mysql.c:2878: warning: assignment makes pointer from integer without
a cast
_mysql.c:2883: error: `PyExc_ImportError' undeclared (first use in
this function)
error: command 'gcc' failed with exit status 1
3.
cd /sw/lib/mysql
(that file is not on my system)
So unabl;e to build the My
Yes the problem was with python-devel. After installing all the
depndebcies, it went through fine.
On Aug 19, 1:20 pm, Thejaswi Puthraya <[EMAIL PROTECTED]>
wrote:
> On Aug 19, 1:16 pm, shabda <[EMAIL PROTECTED]> wrote:
>
> > But even that is not helping. I am on a
When I run the command
$ python manage.py syncdb
I am getting an error like
Failed to install index for auth.Message model: (2006, 'MySQL server
has gone away')Installing index for auth.Permission model
I am on python 2.3.4, mysql 5.0.46, cent OS.
My tables get created though.
What can be the pro
I need to convert a models.datefield to a python type. How can I do
this. In general what is the way to convert the django model data type
to a pure python data type?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
I have a python model
class MyModel(models.Model):
fld1 = models.TextField()
fld1 = models.TextField()
I want to have a non database item in this model class, which I can
populate in the views. What is the recommended way to do this.
--~--~-~--~~~---
http://diveintomark.org/archives/2004/07/06/nfc
I was walking across a bridge one day, and I saw a man standing on the
edge, about to jump off. So I ran over and said, "Stop! Don't do it!"
"I can't help it," he cried. "I've lost my will to live."
"What do you do for a living?" I asked.
He said
That seems too easy to be true. :).
I have one more query, where should I add this code? Considering this
attribute would be used in many views, I am trying to override
__init__.
def __init__(self, *vargs):
models.Model.__init__(self, *vargs)
self.my_item_that_doesnt_exist_in_
Oh shucks, since I want to recalculate this attribute each time, I
would need this to be in the view function.
Still how would I override __init__ in django Models?
On Sep 5, 11:10 pm, shabda <[EMAIL PROTECTED]> wrote:
> That seems too easy to be true. :).
> I have one more query, wh
Traceback (most recent call last):
File "C:\Python24\lib\site-packages\django\core\handlers\base.py" in
get_response
77. response = callback(request, *callback_args, **callback_kwargs)
File "C:\Python24\lib\site-packages\django\contrib\auth\decorators.py"
in _checklogin
14. return view_func(re
I need to write some doctests for my app.
So I am running the interactive shell by
manage.py shell
But since ipython is already installed on my system, the i python
prompt starts and I can't just copy paste the shell output for
creating the doctests. Is there some way I can ask the manage.py
uti
I am trying to deploy django on a fedora 7 system.
After following these steps I am stuck!
(Long tale of woes ahead, If you can just tell me where can I get apxs
for apache, my problem is solved.)
1. Downloaded django, tried running setup.py, got an error saying
something like
unable to open /usr
I am trying to deploy django, and to test the install I am doing this,
I run django-admin.py startproject hello in directory /root/django
I have added to my httpd.conf
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE hello.settings
Many of us would like to do a search for our website from within
django. With django-websearch[1] you can do a search for your site,
any general search on the web. I had talked about this a long time ago
here[2], and had the code, but never got around to posting this
online. The usage instruction
I have an app, and that app is included in the installed_apps in
settings.py. Whn I run manage.py runserver, tables referred in the app
are created. However none of the entities in that table are displayed
in the admin interface, which shows tables from contrib.sites and
contrib.auth. What could I
Damn, I am feeling so stupid now :( . Thanks, that was the problem!
On Jan 6, 11:30 am, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> On 06-Jan-08, at 11:52 AM, shabda wrote:
>
> > I have an app, and that app is included in the installed_apps in
> > settings.py. Whn I
I have a model attribute of type TextField, where I am storing html
data. While displaying in template I do not want to escape it, and so
should mark this as safe. How can I do this? I read the link at
http://www.djangoproject.com/documentation/templates_python/#filters-and-auto-escaping
, but tha
I have a form, to which I want to pass some data when it is first
dipalyed,
My form is,
class EditPage(forms.Form):
text = forms.CharField(widget = forms.Textarea)
edit_summary = forms.CharField()
In my view I bind data to this form as
if request.method == 'GET':
page = Page.o
something like
text = forms.CharField(widget = forms.Textarea, initial =
self.page.text)
I just can't get this to work? Any place where I can look for dynamic
values to initial?
On Jan 6, 2:38 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Sun, 2008-01-06 at 01:32 -0800, shabda
I want to have a models.py like this,
class PageRevision(models.Model):
"""Stores a specific revision of the page"""
text = models.TextField()
revision_for = models.ForeignKey(Page, related_name =
'revision_for')
class Page(models.Model):
"""Stores the latest page, the page which
Django adds an ID field to all models by default. Some questions about
that.
How are the values calculated. If Django asks the DB to provide it
those values, can we be sure, for all supported backends, that
1. The ids are auto incrementing, (and not just unique).
2. They start from zero.
3. The d
instead of
q_list = ObjectPaginator(Queue.objects.all(), 20)
Provide a order_by, if you would like them to be in descending order,
in order when they were created have,
q_list = ObjectPaginator(Queue.objects.all().order_by('-id'),
20)
Or better yet have a created_on field in the model, w
Instead of this
def __init__(self, user):
profile = user.get_profile()
for g in profile.groups.all():
self.GROUP_CHOICES += (g.id, g.name)
super(MyForm, self)
Should it not be,
def __init__(self, user, *args, **kwargs):
profile = user.get_profile()
Ove of my view function is,
def recently_featured (request):
featured = FeaturedPage.objects.all().order_by('-ordering')
paged_featured = ObjectPaginator(featured,
djikikisettings.details_per_page)
try:
page_num = request.GET['page']
page_num = int(page_num)
except:
Override __init__ for the Form, passing it the request object and
store it. Access it in .clean method.
On Jan 12, 10:45 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I also just realized that the reason clean() wouldn't work when I
> tried to pass it the request as an argument is simply b
_dob = request.POST['dob'] gets the string representation of dob, and
so python complains as it can't find the strftime method.
You need to change your code to,
_dob = form_name.cleaned_data['date_attribute_name']
form.cleaned_data, gets you the canonical representation for the data
type dependin
I have a view function I am using for logging in people. When I am
deploying it to Apache/Mod_python, I am unable to login, but If I am
running it on the development server, I am able to login. Any
pointers?
(I am not using the builtin login, as I want to use newforms.)
The view function is,
def
orms.error, and
forms.is_valid fails.
On Jan 13, 11:31 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> What daes it mean "I am unable to login". Error aqcures, exception
> raises or something else?
>
> On 13 янв, 18:33, shabda <[EMAIL PROTECTED]> wrote:
>
> > I hav
Trying to login many times in a row produced this Exception,
Exception Type: SuspiciousOperation at /admin/
Exception Value: User may have tampered with session cookie.
Full traceback,
Traceback:
File "/home/shabda/lib/python2.5/django/core/handlers/base.py" in
get_res
But If it were so how would running it from the development server
allow me to login?
On Jan 14, 5:13 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> On 14-Jan-08, at 5:40 PM, shabda wrote:
>
> > Exception Type: SuspiciousOperation at /admin/
> > Exception Value: Use
You need to change this line
type="text/css" href="testing1.css" />
to
type="text/css" href="/static/testing1.css" />
On Jan 15, 1:00 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On Jan 15, 2008 1:08 AM, laspal <[EMAIL PROTECTED]> wrote:
>
> This:
>
> > (r'^static/(?P.*)$', 'django.views.
Can I
> use django in a shared hosting environment or I need to buy a
> Dedicated server?
While many people run Django in shared hosting, IMHO, that leads to
much more trouble than it is worth. But you surely do not need a
dedicated server for running django. I use Webfaction, and they are
one of
Umm yes, I just meant that you get a own apache, and python instance,
and can customise it.
On Jan 15, 11:17 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> shabda wrote:
> >> use django in a shared hosting environment or I need to buy a
> >> Dedicated server?
> >
I want to use some custom filters, and so I am using the steps given
at
http://www.djangoproject.com/documentation/templates_python/#writing-custom-template-filters
What I did was,
1. Created a templatetags directory under th app and created
__init__.py, myfilters.py under it. Its structure is l
I also have added this to __init__.py
__all__ = ['myfilters']
On Jan 16, 9:31 pm, shabda <[EMAIL PROTECTED]> wrote:
> I want to use some custom filters, and so I am using the steps given
> athttp://www.djangoproject.com/documentation/templates_python/#writing-...
&
t2/', include('test2.foo.urls')),
(r'^$','index'),
the index function is being called.
On Jan 16, 9:54 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Jan 16, 2008 11:31 AM, shabda <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
&g
Save yourself the trouble of writing a view function and use the
generic view direct_to_template
http://www.djangoproject.com/documentation/generic_views/#django-views-generic-simple-direct-to-template
On Jan 17, 12:50 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Jan 17, 2008 2:32 AM, laspa
I am trying to use the manage.py dbshell call. I give the command,
F:\djangoprojects\polls>manage.py dbshell
This is giving me an error like
F:\djangoprojects\polls> ERROR 1045 (28000): Access denied for user
'ODBC'@'localhost' (using password: NO)
However in my settings.py I have set the user an
You have two underscores after start_date in start_date__month,
probably that is the problem. Change this to start_date_month, (one
underscore) and see if it works.
On Jan 22, 2:15 pm, omat <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have a model with a date field. When I try to filter based on it
I want to have the one of the field for my form have a specific css
class. But if I do something like,
widget = forms.TextInput(attrs = {'size':60, 'class':'main'}
The textInput, and not its associated label gets the class. How can I
specify the class for label?
--~--~-~--~~---
Jan 22, 5:23 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> On 22-Jan-08, at 5:45 PM, shabda wrote:
>
> > I want to have the one of the field for my form have a specific css
> > class. But if I do something like,
> > widget = forms.TextInput(attrs = {'size
I have field in a form like,
foo = forms.DateField(required = False, input_formats = '%m/%d/%Y')
Now when I try to enter a date like 10/25/2006 I am getting an error
string index out of range . Full stack trace,
Traceback:
File "C:\Python24\lib\site-packages\django\core\handlers\base.py" in
get_r
This is the right way to do so. Querysets are lazy. Only the rows
needed will be fetched in this example.
code_berzerker wrote:
> theres line of code in tutorial:
>
> Poll.objects.all().order_by('-pub_date')[:5]
>
> this gives 5 Poll objects. I wonder if this is efficient way of
> getting them? D
Does anybody have a code snippet for getting striped tables with
django? Basically I would need to apply alternating classes to the the
rows returned by the rowset. I do not want to do this from javascript,
but from server side.
--~--~-~--~~~---~--~~
You received th
I want to use the ChoiceField to show choices depending on a query
set. For exmple the ChoiceField must get all active Users and them
show them in a drop down, something like what happens in Admin. How
can I do that?
--~--~-~--~~~---~--~~
You received this message b
My model is something like this,
class Job(models.Model):
name = models.CharField(...)
class Entry(models.Model):
job = models.ForeignKey(Job)
hrs_worked = models.IntegerField()
Now I want to get the sum of the hours worked in a job which I can get
by summing Entries for that job.
somet
I have the model like,
class Blog(models.Model):
url = models.URLField()
class Entry(models.Model):
blog = models.ForeignKey(Blog)
user = models.ManyToManyField(User)
User is contrib.auth.db.USER
Now I given a blog and a user I need to find out all the Entry objects
which are a det
(user__ne=some_uesr)
>
> On Jan 26, 6:14 am, shabda <[EMAIL PROTECTED]> wrote:
>
> > I have the model like,
>
> > class Blog(models.Model):
> > url = models.URLField()
>
> > class Entry(models.Model):
> > blog = models.ForeignKey(Blog)
> >
I want to use django-queue-service to run long running processess in
background, but I can not find any documentation about this. Their
website http://code.google.com/p/django-queue-service/ does not
contain any docs. Does any one have any links, about how to use it?
--~--~-~--~~--
When trying to save a model object I get an error saying,
This is the line, which is causing the error. If I remove this line
and add null + True to created_on firld I do not get the exception.
The traceback is at,
http://dpaste.com/32727/
--~--~-~--~~~---~--~~
Yo
on field I do not get the exception.
The traceback is at,
http://dpaste.com/32727/
On Jan 27, 12:26 pm, shabda <[EMAIL PROTECTED]> wrote:
> When trying to save a model object I get an error saying,
>
> This is the line, which is causing the error. If I remove this line
> and a
http://www.b-list.org/weblog/2007/sep/22/standalone-django-scripts/
On Jan 28, 12:39 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I'd like to run a few background processes on my server.
>
> They need access to the models in my app, the database, and the whole
> django framework.
>
> Othe
you use them for learning or in a production setting be sure to let
me know. And if you got a few seconds, can you tell me your opinion at
http://day4.7days7apps.com/poll/Does-7days7apps-suck/
Thanks,
Shabda
--~--~-~--~~~---~--~~
You received this message because you
I want to use guids instead of auto incrementing keys with my models
for primary keys. I am using mysql. Using the UUID funcion in mysql I
can do this, but is there a simpler way?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Goog
I have a model like
class ProjectFile(models.Model):
project = models.ForeignKey(Project)
file = models.FileField(upload_to = '/files/')
class Project(models.Model):
name = models.CharField(max_length = 100)
With this the uploaded files will go to <>/files/,
howeverI want to upload a
I want to subclass CharField so that, its has a widget, and I do not
always need to set it. So I do
class DojoCharField(forms.CharField):
def __init__(self, *args, **kwargs):
super(DojoCharField, self).__init__(*args, **kwargs)
if self.widget == None:
self.widget =
idget'):
kwargs.update({'widget' :
forms.TextInput(attrs={'dojoType':'dijit.form.TextBox'})})
super(DojoCharField, self).__init__(*args, **kwargs)
or some thing similar.
On Feb 8, 12:32 am, shabda <[EMAIL PROTECTED]> wrote:
> I want to subclass CharField
This seems very useful! Is there some way I can wrap my rss feed
within a view function?
My feeds class looks like,
class ProjectRss(Feed):
def get_object(self, bits):
I am using the django.contrib.syndication.feeds.
Michael Elsdörfer wrote:
> > How can I create passwords prot
How can I create passwords protected feeds with Django? I guess I will
have to go beyond the contrib.feeds framework, but if some one has any
recipes/links to how to do this, it would be most helpful!
--~--~-~--~~~---~--~~
You received this message because you are s
I have a model something like,
class Task(models.Model):
name = models.CharField()
parent_task = models.ForeignKey('Task')
is_complete = models.BooleanField()
class TaskItem(models.Model)
name = models.CharField()
task = models.ForeignKey(Task)
is_complete = models.BooleanField()
I
I dunno if this is the answer you are looking for, but if you want to
enforce that there is only one user set unique = True for the user in
the UserProfile class.
class UserProfile(models.Model):
user = models.ForeignKey(User, unique = True)
On Feb 11, 10:42 am, Aaron Fay <[EMAIL PROTECTED]> w
I want my template to raise exception, when an object is not preset or
raises a exception. I am sure there is a setting for it, I just cant
figure out where. Help?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Djan
When using newforms, I want to get the id set on the input field.
I am doing something like,
{% for field in form %}
{{ field }}
...
Now this {{field}} will render as something like,
Withing the template how can I access the value for id. If this is not
possible where in code does Django set th
Umm, if you want to persist state across HTTP requests, why not use
session?
On Feb 14, 2:28 pm, mario <[EMAIL PROTECTED]> wrote:
> Etienne, thanks for answering,
>
> > I believe you got this wrong a little. A HttpResponse object doesn't modify
> > the query string. That should be done in your fo
I have a model like
class File(models.Model):
file = models.FileField(upload_to = 'files')
project = models.ForeignKey(Project)
class Project(models.Model):
name = models.CharField(max_length = 100)
I want to have each file go a specific directory corresponding to its
project_name
So I w
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 disp
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 wr
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 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
>(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
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
Proce
I have some test code written like,
def testDashBoard(self):
c = Client()
print c.login(username = 'Shabda', password= 'shabda')
response = c.get('/dashboard/')
print response.headers[
Aww, I seems a call to c.get('/dashboard/') gets an object of type
HttpResponse while c.get('/dashboard/', {}) gets a Response object.
On Feb 22, 11:50 pm, shabda <[EMAIL PROTECTED]> wrote:
> I have some test code written like,
>
> def testDashBoard(self):
>
Please ignore the previous message. I think I am too sleepy now, and
am seeing things which do not exist. :) .
On Feb 22, 11:57 pm, shabda <[EMAIL PROTECTED]> wrote:
> Aww, I seems a call to c.get('/dashboard/') gets an object of type
> HttpResponse while c.get('/dashb
I have a model like,
class Project(models.Model):
name = models.CharField()
expected_start_date = models.DateField()
actual_start_date = models.DateField()
I want to translate the SQL query,
SELECT * FROM project WHERE expected_start_date > actual_start_date,
I cant do something like
P
I have a form which allows users to upload files.
The form is,
class AddFileForm(forms.Form):
"""Add a file."""
filename = forms.FileField()
I am using S3 to store files, my view is something like,
if request.method == 'POST':
addfileform = bforms.AddFileForm(request.POST, r
1 - 100 of 201 matches
Mail list logo