I just got bit by this too and it turned out that I had done an
install of Django-1.0 on top of an older Django install. In the site-
packages directory there was both a django/contrib/comments/urls.py
(from 1.0) and a django/contrib/comments/urls/ directory which
contained __init__.py and comment
>From a quick scan of the source code, I don't think the object is
passed into the template, but you can get the related content object
directly from the comment (which is passed into the template). Just
use the content_object field of the comment like this:
{{ comment.content_object.slug }} (or
You can do it in a custom eval-like tag:
@register.tag()
def evalpy(parser, token):
try:
tag_name, expression = token.split_contents()
except ValueError:
raise template.TemplateSyntaxError, "%r tag requires a
single argument" % token.contents.split(
Unrelated to Django, but we occasionally get deadlocks in MySQL due to
separate tasks running at the same time and accessing some tables in
common. We recently added logic to catch the exception, wait a second
or two, and retry it a few times before we give up. Most of the time,
that fixes it.
I
create
> a custom kind of DB backend? or did you just add that logic to the
> particular view that was giving you trouble?
>
> Ian
>
> On Wed, Nov 19, 2008 at 1:40 PM, DavidA <[EMAIL PROTECTED]> wrote:
>
> > Unrelated to Django, but we occasionally get deadlock
I do something like you are suggesting: I actually write my "flat"
pages in Markdown since I prefer it to HTML, and I keep the contents
in a file instead of the database, so I can edit them with Emacs. Then
I just route these special pages to a trivial template that uses the
markdown filter to ren
> I think the basic issue is that there are some fields in the object
> that I'd like to display but not have editable, and it's not at all
> clear to me how to make that happen in the form processor. The values
> are dynamic, so they can't be in the template.
I often have this need so I created
If I undestand the problem correctly, in MySQL you could do this in
one query as:
select
m.*,
(select min(created) from model2 where id = m.model2_id) as
first_created,
(select max(created) from model2 where id = m.model2_id) as
last_created
from model1 m
;
I don't know how that tran
This sounds suspiciously similar to the problem I had with initial SQL
scripts in MySQL. In my case I was inserting rows into a table and one
of the string fields contained %. I had to "escape" the % (using %%).
I'm guessing that the SQL isn't directly executed but somehow
evaluated in the django.
I have two models, Trade and Fill. A Trade can have many fills. Fill
has a FK to Trade:
class Trade(models.Model):
trade_date = models.DateField(auto_now_add=True, editable=False)
side = models.CharField(max_length=12, choices=SIDE_CHOICES)
inst = models.ForeignKey(Inst)
class Fill(m
The problem is that trade is required so is_valid will fail.
On Dec 13, 5:01 pm, Daniel Roseman
wrote:
> On Dec 13, 9:30 pm, DavidA wrote:
>
>
>
> > I have two models, Trade and Fill. A Trade can have many fills. Fill
> > has a FK to Trade:
>
> > class Trade(
I'm getting this error when I try to remove an inline model instance
in the Django admin:
Traceback:
File "C:\Python25\lib\site-packages\django\core\handlers\base.py"
in get_response
92. response = callback(request, *callback_args,
**callback_kwargs)
File "C:\Pyt
trace.
def __unicode__(self):
try:
return self.document.url
except:
return u'File deleted'
Thanks,
-Dave
On Sep 25, 10:36 am, Karen Tracey wrote:
> On Fri, Sep 25, 2009 at 9:05 AM, DavidA wrote:
>
> > I'm getting this error whe
I'm trying to understand how to use aggregation with "computed
columns", that is, columns that are expressions defined in the extra()
method, but it seems these aren't available in downstream parts of the
query:
class Trans(models.Model):
parent = models.ForeignKey('self', null=True, blank=Tr
I have some scripts that run tasks and use Django DB models. They have
been running an hour late today after all the DST changes (here in the
US). I've traced it down to any call to Django is shifting my time
back an hour (like it was before this weekend's shift).
So the time as reported by time.
I found a workaround but I'm not sure what the ramifications are. I
commented out this line in django.conf.__init__.py:
os.environ['TZ'] = self.TIME_ZONE
On Mar 12, 10:19 am, "DavidA" <[EMAIL PROTECTED]> wrote:
> I have some scripts that run tasks and use
Thanks. I am on trunk, 4227 so I don't have this fix.
On Mar 12, 10:53 am, "Ramiro Morales" <[EMAIL PROTECTED]> wrote:
> On 3/12/07, DavidA <[EMAIL PROTECTED]> wrote:
>
>
>
> > I found a workaround but I'm not sure what the ramifications are. I
&
Luis P. Mendes wrote:
> But if he chooses to apply five filters, there will have to be five
> filter methods appended, or five key=values pairs as arguments.
You can do something like this:
from django.db.models import Q
def my_view(request):
query = Q()
for i in range(1, 13):
Ulrich Nitsche wrote:
> hi,
>
> i have two models (tables) concerning user data which belong together.
> Now I would like to use one single form to display and edit these
> values.
> Is there a way to use one changemanipulator to do this?
> Or if this is not possible is there a way to use differe
Gábor Farkas wrote:
> hi,
>
> i've just checked and SlugField does not imply unique=True.
>
> i somehow always assumed that it does.
>
> so before i go and add the unique=True to all my SlugFields,
>
> is there any reason to have non-unique SlugFields?
>
> as far as i understand, SlugFields are mo
viestards wrote:
> thanks, suppose I have to do it this way. I just hoped to have a
> sollution that works in admin pages too.
I also ran into this problem so I did it that hard way: I created a
custom model DateField and a custom form DateField. (I call them
RelaxedModelDateField and RelaxedForm
[EMAIL PROTECTED] wrote:
>
> Here's my anecdote on that.
>
> Even though it was literally staring me in the face, it took me AGES to
> discover that the error dump page is actually interactive and has
> little sections that expand and collapse.
> I kept running into error messages which told me a
I have a number of views where function args (parsed from the URL conf)
and/or query string arguments are used to filter the results that are
displayed in a template. The template includes paging and sorting which
need to use a URL that points back to the view using the same
arguments, but I'm fin
va:patrick.kranzlmueller wrote:
> I have a model with blog-postings, assigned to a specific user - the
> user is stored in the table "posting" via foreignkey.
>
> the user is part of a grade, part of a school and part of a state -
> all of which have overview-pages.
> so, to get all the postings
Geert Vanderkelen wrote:
> Did you forget to do
> mysql> SET NAMES 'UTF8";
> when selecting in your client?
>
That's done automatically for you in
django.db.backends.mysql.DatabaseWrapper.cursor:
if self.connection.get_server_info() >= '4.1':
cursor.execute("SET NAMES 'utf
Tom Smith wrote:
> With about a million records I can't imagine doing it any other way...
>
> I want to find my top 100 words (by product_count) then sort them
> alphabetically to make a tag cloud...
>
> thanks...
If you are only dealing with 100 records after the query, then its not
a big de
Guillermo Fernandez Castellanos wrote:
> That's it, thanks!
>
> G
>
> On 10/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > Here is a link to the Django Powered Sites:
> >
> >
> > http://code.djangoproject.com/wiki/DjangoPoweredSites#Variousapplications
> >
> > Look for WorkStyle. Th
Russell Keith-Magee wrote:
> On 10/19/06, zenx <[EMAIL PROTECTED]> wrote:
> >
> > I want to get the maximum and the minimum values of various numbers. Is
> > the following method the best way to do it?
>
> The most efficient way would be to use SQL; this way, the min and max
> would fall out as t
Frankie Robertson wrote:
> Yes, dropping down is a good thing. You'll never be able to do
> everything with django's simple ORM. Raw SQL is a 'good thing',
> honest. Once we get SQLAlchemy we can drop to that some of the time
> but until then SQL is the way forward.
Slightly OT, but...
I'm curi
I have some models that look like this
class Analyst(models.Model):
name = models.CharField(maxlength=20, unique=True)
class Strategy(models.Model):
name = models.CharField(maxlength=20)
description = models.CharField(maxlength=80)
class Inst(models.Model):
strategy = models.For
[EMAIL PROTECTED] wrote:
> It's really a fine point, and I probably will use cycle next time
> something like this rolls around, but I don't like it putting an
> unnecessary class in there.
>
> If I could {% cycle even, "" %} or something, I'd probably be
> completely sold.
I recently migrated a
DavidA wrote:
> I have some models that look like this
>
> class Analyst(models.Model):
> name = models.CharField(maxlength=20, unique=True)
>
> class Strategy(models.Model):
> name = models.CharField(maxlength=20)
> description = models.CharField(maxl
Michael Radziej wrote:
> DavidA:
> >
> > DavidA wrote:
> >> I have some models that look like this
> >>
> >> class Analyst(models.Model):
> >> name = models.CharField(maxlength=20, unique=True)
> >>
> >> class
I'd like to see this type of support in the main branch, not separated.
It seems that better support for floating point is just a deficiency in
Django today and the aggregation need crops up everywhere - not just in
scientific applications.
My needs for aggregation are simply for reporting: e.g.
Alan Green wrote:
> On 12/1/06, James Bennett <[EMAIL PROTECTED]> wrote:
>
> > Now, does anybody want to talk about Django?
>
> Yes!
>
> Is anyone writing financial or money-handling applications in Django?
> Any particular issues or "gotchas" the world should know about?
Sort of. I work at a hed
[EMAIL PROTECTED] wrote:
> We're driving right past each other on the information
> superhighway.
> Thanks for your advice, Russ. It still seems to me that a
> many-to-many relationship between days and events would be desirable,
> for the same reasons that all many-to-many relationships are
oliver.lavery wrote:
>
> class Photo( Model )
> def save( self ):
> c = Photo.objects.all().filter( name = self.name ).count()
> if c > 0:
> self.name += '_' + str( c + 1 )
> Model.save( self )
This won't work as you expect. The first file named 'foo' will be saved
a
MC wrote:
> Problem:
> I order dates and null values in ascending order under MySQL. To my
> surprise, null values are listed first, then actual dates. Turns out
> that in MySQL, null values are LOWER than non-null values, whereas
> Postgresql is the reverse. As outlined here
> http://troels.arvin
JHeasly wrote:
> Hello all,
>
> I'm following the "Serializing Django objects" documentation and have a
> view pretty much verbatim from the docs:
>
> def my_json_view(request):
> data = serializers.serialize("json", Location.objects.all())
> return HttpResponse(data, mimetype='text/javas
Saurabh Sawant wrote:
How about the types of web applications for which Django is not well
suited for?
Saurabh,
I've been using Django for almost a year now and would have to say its
worked very well for most every type of application I've tried with it.
To name just a few:
- the obligatory
ak wrote:
A bit more info:
print user.tariff.monthly_fee.__class__, user.balance.__class__,
user.tariff.monthly_fee, user.balance, user.tariff.monthly_fee/3 >
user.balance
displays:
180.00 1846.85 True
while 180/3 = 60 which is ofcourse less than 1846.85 so it should
display False in the
Saurabh,
The other thing I was going to say was that what I really found helpful
about Django was the community and how patient and helpful they were.
And then I read the other replies to your question.
I don't know why everyone is giving you such a hard time. Sure, you
could have phrased your
Is it possible your Apache server is doing reverse DNS lookups on the
GET requests and the lookup is failing for the client machine? I seem
to remember older versions of Apache having this on by default. You can
turn it off with this in your httpd.conf file.
HostnameLookups off
Of course, I'
Chris,
I seem to recall running into this same issue using MySQL on Windows.
What version of MySQLdb are you using. If I'm remembering this
correctly, I was using an older version of MySQLdb which mapped DB
float/numeric fields to str and then I updated it and the newer version
mapped them corre
I found this patch which fixes it. I've been using it for a while now:
http://code.djangoproject.com/ticket/2210
Honza Král wrote:
> this works fine, but if you forget the select_related() it will result
> in a cross join which is probably the last thing you want from your
> database...
>
> I was
Hi All,
I'm the CTO of a medium-sized hedge fund in Greenwich, CT and have
been the sole developer for our internal software projects. There's
too much on my plate for me to handle by myself and I'm looking to
hire a full-time Django/Python developer. I've been an avid reader and
occasional poste
But for every model? Sounds a little kludgy to have to add that to
every model just to break them into separate files.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, sen
Can't you just accomplish the same goal by adding a couple of lines to
your settings file? Assuming you had an environ variable DSN set like
this:
DSN=ENGINE=mysql;NAME=data;USER=root;PASSWORD=redpill;HOST=localhost
then add:
import os
dsn = dict([kv.split('=') for kv in os.environ['DSN'].split
I just googled: django 0.95 site:www.djangoproject.com
and found one other thing that could be potentially confusing:
http://www.djangoproject.com/documentation/tutorial1/
The sample output under "The development server" section shows: Django
version 0.95 (post-magic-removal).
Of course, that i
I've used Python with IIS for the MoinMoin wiki (where do they get
these names?). They have a good doc on configuring IIS for Python:
http://moinmoin.wikiwikiweb.de/HelpOnInstalling/InternetInformationServer#head-890abdbd0d21bf874ce794be87067abf433a51d7
I've done it. It works fine. And then I wok
I should have clarified: I use Apache2 on Windows (and Linux for that
matter). As Ian pointed out, Apache2 is multi-threaded and works very
well on both Linux and Windows.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gro
> Ok. So if work, what reason you have for ditch it for Apache?
There were really four reasons I moved from IIS to Apache:
1) Virtual hosting: although you _can_ do virtual hosting on IIS, you
really need IIS6 on Win2k3 to support the host header fields. The
default IIS on XP Pro doesn't allow th
Mary,
If I'm understanding you correctly you can simply use the 'values'
method of the DB-API to query the value of the field for all rows:
>>> from danet.blog.models import Post
>>> Post.objects.values('slug')
[{'slug': 'yet-another-django-blog'}, {'slug':
'fun-at-home-and-zoes-first-birth
day'
I'm running my Django blog (http://davidavraamides.net) on Fedora under
VMWare GSX 3.1. I have it configured for 256M (the physical box has
1GB). There is another Fedora guest running phpBB similarly configured.
My typical load across all VMs is about 3%. It works great. Both are
running Apache +
Russell Blau wrote:
> Ahh, thanks, it always helps to take the blinders off. The only downside is
> that I have to learn how to use yet another software package. ;-)
An alternative that stays inside Django is to setup a trigger in cron
(or NT's Task Scheduler) that gets a URL every few minutes
Jarek Zgoda wrote:
> I second that. Actual code may vary, but domain model (and its
> representation as Django data model) would remain constant, as long as
> software will be performing similar tasks.
Well, maybe. I think its really hard in any real application to have a
one-size-fits-all data
Kristoffer wrote:
> So, I have decided to use Docutils now, but I am a bit lost.
> How do I do this http://code.djangoproject.com/wiki/UsingMarkup with
> Docutils?
>
> Thanks,
> Kristoffer
Kristoffer,
I think that document is a little misleading. Its more about saving the
post-processed HTML out
Chris,
If I understand your problem, its that you want to do an "and" across
multiple rows, which is not a simple query (and I'm not sure how to do
in the model API). To be more clear, your Sub_Item table relates
through a many-to-many relationship to ObjectItem so the SQL to get all
Sub_Items wi
I have a similar problem where I want to maintain an audit trail for
"manual overrides" to inputs to our risk loop. I haven't implemented it
in Django yet, but the way I've done this in the past is similar to
Waylan: using a history version of the table. There are a few
differences, however. My ta
Bram,
You can add this to your model:
class Meta:
ordering = ('name',)
Here is the documentation:
http://www.djangoproject.com/documentation/models/ordering/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gr
mamcxyz,
I've had pretty good luck with Fedora Core 4. Here are my (terse) notes
from setting up Django and my blog on FC4 a couple of weeks ago. Note
that FC4 already had MySQL 4.1.x and Python 2.4.1 and Apache 2.0.54
(with mod_python) so I just went with them. On Windows I use MySQL 5
but I hav
Patrick J. Anderson wrote:
> {% load comments.comments %}
>
>
> {% for p in latest %}
> {% get_free_comment_count for blog.post object.id as comment_count
> What could be the reason for failed lookup on key[id]?
Shouldn't that be 'p.id' rather than 'object.id' in the
get_free_comment
I'm trying to write a filter that will highlight substrings in text
that matched a search pattern. I was hoping to do something like this:
{{ obj.field|highlight:search }}
where 'search' is a template-context variable that is the string the
user was searching for and the highlight filter woul
RajeshD wrote:
> Don't know if a filter can do what you need. But you could turn this
> into a tag instead of a filter:
>
> {{ highlight search obj.field }}
Thanks. That worked nicely.
It would be nice, however, if filters had access to the template
context so you could do more sophisticated th
You could just check the count of that many items (since its unique it
should always be 1 or 0):
if Photo.objects.filter(flickr_id=photo("id")).count() == 0:
# create the object ...
But its my understanding that Python exceptions are not as heavy weight
as they are in languages like
Malcolm Tredinnick wrote:
> On Mon, 2006-07-03 at 08:54 -0700, Glenn Tenney wrote:
> > Perhaps instead of relying on the behavor of the object's ID not
> > existing until it's been created, that should become a method.
> > something like Model.created() returning true/flase or Model.is_created
>
Malcolm Tredinnick wrote:
> On Tue, 2006-07-04 at 02:11 +0000, DavidA wrote:
> I'm not sure a created() method is going to be the right API, since this
> event has very transitory relevance, but your example does suggest we
> may need something extra here at some point.
I a
One related question on nullable foreign keys: does the Django ORM
always use inner/left joins for select_related() calls? If so, null FKs
will cause rows to be excluded from a query so you may have to handle
these with direct SQL.
Personally, I often create an "unknown" row in a table (and do a
Malcolm Tredinnick wrote:
> You've drifted a bit from the original topic here, though, haven't you?
Um, yes. Guilty as charged...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to th
I've been having a problem rebuilding my database from scratch via
syncdb. I've tracked it down to duplicate constraint name. Here is the
output from manage.py sql for my app:
ALTER TABLE `data_rawinst` ADD CONSTRAINT
`inst_id_referencing_data_inst_id` FOREIGN KEY (`inst_id`) REFERENCES
`data_ins
As soon as I hit "Post" I realized this should be in django-developers.
I'll do that now...
--~--~-~--~~~---~--~~
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@goo
Suriya,
You will probably have to do this in custom SQL or using extra(). Your
query requires a subselect to get the "current B's" (B's with max(date)
for each A).
Here's the SQL that I think you need (if I understand the problem
correctly):
select * from _A join _B on _B.a_id = _A.id
where _B.
Akatemik wrote:
> > In my experience, when you encounter non-obvious but fairly consistant slow
> > downs in net traffic, the first thing to check is DNS.
> >
> > In this case, I'd make sure that each of the DNS cache servers that the
> > client
> > consults to resolve the address of your server
Malcolm Tredinnick wrote:
> Um, Dave? The original poster was using the development server. Apache
> doesn't get a seat at the table here. :-)
Er ... in my best Emily Litella impression: "Never mind"
--~--~-~--~~~---~--~~
You received this message because you ar
PythonistL wrote:
> To explain:
> Let's suppose we have a command
>
> HistoryList=historys.get_list(id__exact='2',order_by=['-PostedDate'])
>
> that command extracts a few records and from them I would like to use
> for further processing all without the first or last record.
> How can I do that
I'm sure I'm just misunderstanding how manipulators and validators
work, but I can't see the right way to do this: I want to support more
formats for a DateField then just '-MM-DD' (which is checked in
DateField by isValidANSIDate).
It seems like I can add *more restrictive* validators but ca
Steven Armstrong wrote:
> I've had similar problems and solved them like this:
>
> myproject/validators.py
> %<--
> from django.utils.translation import gettext_lazy as _
> from django.core.validators import *
> import re
>
> my_ansi_date_re = re.compile('put regexp her
Steven Armstrong wrote:
> On 08/10/06 20:25, DavidA wrote:
> > Steven Armstrong wrote:
> >> I've had similar problems and solved them like this:
> >>
> >> myproject/validators.py
> >> %<--
> >> fr
Hancock, David (DHANCOCK) wrote:
> So, I¹d appreciate any pointers to documentation, code, etc. to let me log
> queries to a file.
David,
While not exactly what you want, I wrote a simple middleware class to
track page-generation stats when calling a view. In it, I count the
number of queries a
Seth Buntin wrote:
> So how will I get the queries if more than one word is used to search?
> The only reason I am using the way I am is in case people search
> multiple words. Can I run queries and add them together or something?
Seth,
I do a similar thing using the ORM's Q object:
from d
[EMAIL PROTECTED] wrote:
> Hi all,
>
> i have the following scenario for a real-estate search engine:
>
> "Ad" table where i define the properties of the ad such as created_on,
> expires_on, user_id and is related with a 1-1 FK to the "Property"
> table which defines stuff such as sq_feet, distri
[EMAIL PROTECTED] wrote:
> I've been refactoring some stuff to use slugs, and it looks like
> FreeComment needs an object.id
>
> Is this correct or have I missed something?
>
> Derek
The FreeComment model assumes the primary key of the object it refers
to is an integer, so you can't make the pri
Derek Hoy wrote:
> Some of the slug examples use slug as PK. Funnily enough, your blog
> example does :)
> http://davidavraamides.net/blog/2006/05/11/yet-another-django-blog/
Yes, and that's how I learned about the problem. If you would have
stumbled upon this later post, you would have seen th
Gary Wilson wrote:
> I see that there is a _get_sql_clause() method, but is there a function
> that will return the constructed query string?
You can just do the same construction that's done in
django/db/models/query.py:
>>> from danet.blog.models import Post, Tag
>>> qs = Tag.objects.filter(t
Gary Wilson wrote:
> [EMAIL PROTECTED] wrote:
> > > def tags(request, url):
> > > # Don't need the last item in the list since it will
> > > # always be an empty string since Django will append
> > > # a slash character to the end of URLs by default.
> > > tags = url.split('/')[:-1
[EMAIL PROTECTED] wrote:
> That works easily when you're just looking up one Tag. What I'm trying
> to figure out is the best way to search for multiple tags and return
> only the Posts common to all of those tags:
Joe,
My bad. I misunderstood your question. I think the only way to do this
(in S
primitive wrote:
> Is it possible to use a string (coming from an request object) as a
> keyword to filter? I keep getting errors, but I don't know how to
> convert these strings into types that filter will understand.
Sure, Python allows you to pass a dict as a set of keyword arguments,
so you
world_domination_kites wrote:
> ---
> But then, alas:
> ---
> Traceback (most recent call last):
> File
> "c:\Python23\Lib\site-packages\Django-
Adam Kelly wrote:
> In the view:
> rows = zip( *[ ( thing.name, thing.color, thing.weight ) for thing in
> object_list ] )
>
> In the template:
> {% for row in rows %}
>
> {% for item in row %}
> {{item}}
> {% endfor %}
>
> {% endfor %}
To generalize this a bit more, you could do:
rows = zip(
Hi Joe,
There is a "schema evolution" project underway to address this problem
in a more automated way, here is background on the project:
http://code.djangoproject.com/wiki/SchemaEvolution
but I don't know anything about the status of it.
But to respond to your question, I have two projects w
Guillermo Fernandez Castellanos wrote:
> I am thinking of using the comments framework for a project, although
> besides the FreeComment there's no real documentation about it that I
> have found besides the source.
This might help:
http://www.b-list.org/weblog/2006/07/16/django-tips-hacking-fre
I have a model whose identity is defined by two fields: a foreign key
field and a boolean field. I'm trying to use a ChangeManipulator for it
but am stuck because ChangeManipulator assumes there is a single
primary key field.
Has anyone run into this? Can someone suggest a workaround?
Thanks
-Da
DavidA wrote:
> I have a model whose identity is defined by two fields: a foreign key
> field and a boolean field. I'm trying to use a ChangeManipulator for it
> but am stuck because ChangeManipulator assumes there is a single
> primary key field.
>
> Has anyone run
I'm experimenting with 'inspectdb' so I can use Django on an existing
database. I was curious to see what inspectdb would return for the
tutorial tables (Polls, Choices) and was confused by the output:
class PollsChoice(meta.Model):
id = meta.IntegerField()
poll_id = meta.IntegerField()
I just want to echo Peter and Ivan's sentiments on NOT making this
default behavior. What attracted me to Django was a simple, fast,
elegant framework for quickly building common types of web
applications. I've wandered into the tarpits of J2EE in my past life
and I was looking for something at th
I found the cause of this magic "multiply by 3" but I don't understand
it well enough to offer a solution. In the mysql backend, there is this
clause (lines 69-70 in DatabaseWrapper.cursor):
if self.connection.get_server_info() >= '4.1':
cursor.execute("SET NAMES utf8")
Setti
I'm a little confused about the "right" place to put templates for an
app. In my mind, the templates are going to be specific to the
application, thus the obvious place to put the templates directory is
in the app directory. Ex:
/some_path/
myproject/
myapp/
models
Thanks. After thinking about it some more, now the idea of having app
directories beneath the templates directory makes sense: I will have a
project-level banner and nav bar that will be used by multiple apps. So
I moved my templates directory back to where it was, right under the
project director
I've read this documentation:
http://www.djangoproject.com/documentation/modpython/
but I can't figure out how to configure the VirtualHost section to get
the URLs I want.
Here's what I'm trying to do:
I have one Django project (data) with two apps under it (trades,
marks). I also have the admin
I am prepopulating my database with data from a number of flat files.
I've written a small script to do this using my model class. While this
works, there are a couple of kludges I made to get it to work and I was
hoping someone could advise my on a better way to do this.
First, to use the model
1 - 100 of 111 matches
Mail list logo