django 1.4
topapp
urls.py
...
url(r'^shows/', include('shows.urls')),
template
base.html
... {% url shows.views.customers %}
shows
urls.py
..
url(r'^customers/$', 'shows.views.customers')
The above works just fine -- everything is happy except for the deprecation
w
think that the admin should accept such a (properly formed) date
string. Or else the model shouldn't validate.
On Dec 8, 2:20 pm, Wayne Smith wrote:
> On Wed, Dec 8, 2010 at 10:49 AM, JeffH wrote:
> > So I'm working along, everything's humming fine. Then I try to add a
>
So I'm working along, everything's humming fine. Then I try to add a
record via the admin, and get the following:
TemplateSyntaxError at /admin/expert/expertresponse/add/
Caught AttributeError while rendering: 'unicode' object has no
attribute 'date'
[snip]
Template error
In template c:\python2
Another approach that I used recently:
# urls.py
(r'^ThankYou/(?P\d{4})/$', views.ThankYou),
# message defs in views.py
# messages for ThankYou page
ty_messages = {
'' : 'Invalid message specified.',
'0001' : 'Pending dealer record has been re-saved, awaiting
approval.',
'0002'
r original queryset).
>
> Scott Gould's answer is about as good as you'll get I reckon.
>
> On Jun 21, 3:37 pm, JeffH wrote:
>
> > That looks reasonable... but I wonder if the ORM can do it directly
> > somehow. Anyone?
>
> > On Jun 21, 10:14 am, Scott
_answers = [(q, [a for a in answers if a.question = q])
> for q in questions]
>
> ...which should give you a list of (question, )
> tuples.
>
> On Jun 21, 10:00 am, JeffH wrote:
>
> > To clarify: Each race has a set of questions. The candidate may have
> > responded
answers get displayed.
On Jun 21, 8:41 am, Daniel Roseman wrote:
> On Jun 21, 12:51 pm, JeffH wrote:
>
>
>
> > I have some models that (simplified) look like the following.
>
> > class Answer(models.Model):
> > id = models.CharField(max_length=3
I have some models that (simplified) look like the following.
class Answer(models.Model):
id = models.CharField(max_length=32, primary_key=True)
text = models.TextField(blank=False)
question = models.ForeignKey(Question)
candidate = models.ForeignKey(Candidate)
class Question(mode
Valcato.com offers shared and dedicated hosting, including good Django
support. I've got two Django sites with them now. Home office is in
UK. --Jeff
On Apr 4, 8:33 pm, Nick Lacey wrote:
> Matt wrote:
> > plus im uk based so phone wouldn't really help.
>
> Speaking of being UK based .. for the
Hello,
I'm a relative newcomer to Django and love it. I'm having a problem
with a m:m relationship in the admin. Stripped down, I have two
models, Fact and FactSet
class Fact(models.Model):
Name = models.CharField(max_length=64, unique=False, blank=False,
db_index=True)
class FactSet(models.
Tried DreamHost, which is OK for shared static sites; fuggetaboutit
vis a vis Django. I've been using http://www.valcatohosting.com/. They
have some good getting started docs and excellent support. Good for
low volume shared hosting. For a large upcoming project, I'm looking
at either Linode or Sli
Thanks. I can live with it. The main thing is knowing I'm not
crazy. ;-)
On Jul 9, 8:00 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Wed, 2008-07-09 at 04:51 -0700, JeffH wrote:
> > I have a URL mapping problem, running 0.96.2 on Windows.
>
> > The proble
I have a URL mapping problem, running 0.96.2 on Windows.
The problem: I have to specify the site name in the urls.py or else I
get 404s.
For example:
urlpatterns = patterns('',
(r'^/$', home),
(r'^/home/$', theview),
(r'^SouthHavenReservations/home1/$', theview1),
(r'^SouthHavenR
I agree with Doug B's advice - I've used that "list of forms with
different prefixes" technique and it works very well and the code
should be easy for others to follow down the road. You actually don't
need a prefix hidden field for each fieldset - one hidden field
containing the number of fieldse
I use the following:
my pythonpath includes /usr/local/lib/django/
within which I have:
apps/
app1/(models,views,urls)
app2/(models,views,urls), etc.
vhosts/
vhost1/(settings,urls)
vhost2/(settings,urls), etc.
within the config for each apache virtual host
> > 3. That said, my delete_objects() hack was an attempt to solve the
> > more general problem of using an overridden delete() without any
> > special flags while allowing for the possibility of model subclassing
> > in the future, because it seemed that respecting an overridden
> > delete() was
ion (by
omission) that overriding delete() is analogous is incorrect.
5. A big ongoing thanks to all of Django's contributors. You rock!
Thanks for reading this.
Cheers,
Jeff
On Jul 15, 1:24 am, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 7/13/07, JeffH <[EMA
more efficient that my way of do it, I was getting the
> user from the database to see if the user exist. I like your solution, is
> pretty clean and simple. Thanks a lot.
>
> On 7/13/07, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote:
>
>
>
> > On 7/13/07,
this works for me:
if getattr(model_instance, 'id', None) is None:
model_instance.created_by = whatever
On Jul 13, 1:28 pm, "Lic. José M. Rodriguez Bacallao"
<[EMAIL PROTECTED]> wrote:
> Hi, I got a little problem. I need to store in a model the first user who
> created it (created_by) and the
This post relates to two separate Django issues that intertwined for
me:
1. Lack of aggregation support in Django's ORM
(I am delighted to see
http://groups.google.com/group/django-developers/browse_thread/thread/f433edf7b0ebdbcb/
)
2. Django does not use delete() methods for related objects
(as
Two thoughts on this:
First: you could define an appropriate label for the dynamic
formfields as you create them in your FormList class (not shown here)
such as the name of the thing that would be deleted, and then use the
as_p shortcut to render the whole form rather than trying to loop:
with a
Is this worthy of a ticket?
Observed behavior: Django (v0.96) render_to_response renders a
template but renders nothing for {{ form.as_table }} tag when
(unbeknownst to the poor programmer) a TypeError exception is raised
during the rendering of a custom newforms widget.
My preferred behavior: g
22 matches
Mail list logo