Re: Need to trigger action on 4th Saturday of the month

2023-07-25 Thread Ross Meredith
No need to involve anything asynchronous, if I understand you correctly. Just check when the request is made whether it's the right time. If so process the registration, otherwise show the other page to indicate it's the wrong time. Ross On Tue, Jul 25, 2023 at 7:13 PM M Cain wrot

Re: Combining two subquery counts using ORM

2022-11-09 Thread Ross Meredith
Last time I checked you can't use subquery inside the FROM clause. If you can please let me know how because I had this a while back and got stuck. I ended up using a package called django-cte. On Wed, Nov 9, 2022 at 9:01 PM Matthew Hegarty wrote: > Thanks > > I made some progress, and this get

Re: Delivery Status Notification (Failure)

2022-09-17 Thread Ross Meredith
This is the wrong approach. You should use a model form. On Sat, Sep 17, 2022 at 8:54 PM Nishant Sagar wrote: > > Hey folks, > While saving the values to the data to the database I'm getting this Field > 'roof_age' expected a number but got ('1',) > > How can I resolve this? > Here is my views.

Re: Potential admin bug

2022-08-03 Thread Ross Meredith
It's more likely a set up problem than a bug I'd have thought. If it helps here is the relevant code - https://github.com/django/django/blob/main/django/contrib/admin/options.py#L132 . def response_add is the method which determines what the response to use after a successful addition. On Wed, A

Re: Pass or refer parent query value into subquery

2022-07-26 Thread Ross Meredith
Sorry I haven't used the JSONField myself before. On Tue, Jul 26, 2022 at 5:01 PM Sencer Hamarat wrote: > Thanks Ross, > Very appreciated. > That's what I need. > > I'm also having a problem with this query after I implemented the solution: > > I believe, &g

Re: Blog application with django

2022-07-26 Thread Ross Meredith
you how to build a blog. On Tue, Jul 26, 2022 at 4:42 PM MAHESH KUMAR wrote: > click above link in mail i want that type of Blog application > > > On Tue, Jul 26, 2022 at 9:04 PM Ross Meredith > wrote: > >> Sorry it's not clear what you are asking. >> &g

Re: Blog application with django

2022-07-26 Thread Ross Meredith
Sorry it's not clear what you are asking. On Tue, Jul 26, 2022 at 4:33 PM MAHESH KUMAR wrote: > Hi all > > https://www.health.harvard.edu/mind-and-mood/relaxation-techniques-breath-control-helps-quell-errant-stress-response > > I want this type blog application please help me anybody coding part

Re: Pass or refer parent query value into subquery

2022-07-26 Thread Ross Meredith
https://docs.djangoproject.com/en/4.0/ref/models/expressions/#django.db.models.OuterRef On Tue, Jul 26, 2022 at 4:27 PM Sencer Hamarat wrote: > Hi, > > I need to pass the parent query book_id value into the subquery. > Here is the model and the current state of the query I reached. > > class Pub

Unable to log in the user using django channels because "connection is already closed"

2021-09-04 Thread Ross Meredith
this method is not an option for me when I try). This is the full traceback - Traceback (most recent call last): File "/home/ross/.local/share/virtualenvs/chat-A0fEktPe/lib/python3.8/site-packages/promise/promise.py", line 489, in _resolve_from_executor executor(resolve, rejec

Re: GeoDjango with SpatialLite on Windows 10

2021-08-12 Thread Michael Ross
ciate any help > Thank you[image: error.png] Maybe this helps: https://stackoverflow.com/questions/53682315/error-on-libcurl-dll-when-using-gdal-of-osgeo4w-in-django TLDR: IntelliJ loads wrong sqlite3.dll? -- Michael Ross -- You received this message because you are subscribed to the Google Groups

Re: how does Django handle outbound requests?

2021-06-27 Thread Michael Ross
roup and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/20152777-2847-4b94-974c-27be70ee04can%40googlegroups.com. -- Michael Ross -- You received t

Trying to understand duplicate results from related_set

2021-03-31 Thread Michael Ross
ia give me correct results, get_medium(0), get_medium(1) == 9, 13 but if I don't, I get a duplicate row? get_medium(0), get_medium(1) == 9, 9 -Michael -- Michael Ross -- You received this message because you are subscribed to the Google Groups "Django users" group

Re: multiplying two fields

2021-01-29 Thread Ross Meredith
com> wrote: > tanks Ross, i fixed my error but now only show me this > > >>> data = Articles.objects.all().annotate(F=('cost_buy') * > F('quantity')).output_field=FloatField('result') > >>> print(data) > > >>&g

Re: multiplying two fields

2021-01-29 Thread Ross Meredith
Apologies, typo myself! That meant to say "typo" not "type". On Fri, Jan 29, 2021 at 9:52 PM Ross Meredith wrote: > > data = Articles.objects.all().annotate(result=F('coust_buy') * > F('quantity')).output_field=FloatField('result

Re: multiplying two fields

2021-01-29 Thread Ross Meredith
data = Articles.objects.all().annotate(result=F('coust_buy') * F('quantity')).output_field=FloatField('result'), contains a type for the field "cost_buy" (i.e. not "coust_by"). If that isn't it please give us the traceback. On Fri, Jan 29, 2021 at 8:50 PM jose angel encinas ramos < encinasj.an..

Django Accountancy Desktop App Inspired By Xero

2021-01-23 Thread Ross Meredith
Hi guys, I have just finished my first ever full stack web app, which is built with django of course. It is an open source accountancy app based partly on Xero, one of the leading products in the market, but with some differences. It is by no means a complete accountancy system but I hope it

Configuring a StaticLiveTestCase Server In A Docker Container

2019-12-23 Thread &#x27;Ross' via Django users
Hi, I am able to spawn a separate live development server process for a selenium test which inherits from LiveServerTestCase with the following - #globals HTTP = "http://"# ip address of host machine on the default docker network LOCALHOST = settings.HOST_LOCALHOST# port number on host the d

Re: Custom Template Tags Render Method

2019-11-24 Thread &#x27;Ross' via Django users
I meant to write "indeed this section of the same article seems to support this - https://docs.djangoproject.com/en/2.2/howto/custom-template-tags/#auto-escaping-considerations " On Sunday, November 24, 2019 at 6:43:44 PM UTC, Ross wrote: > > To create our own custom template

Custom Template Tags Render Method

2019-11-24 Thread &#x27;Ross' via Django users
To create our own custom template tags we have to define a Node subclass which implements a render method. Example from https://docs.djangoproject.com/en/2.2/howto/custom-template-tags/#auto-escaping-considerations import datetimefrom django import template class CurrentTimeNode(template.Node):

Re: [ANN] Django 1.4.2 and 1.3.4 remedy security issues

2012-10-17 Thread Ross Poulton
Django==1.3.4 doesn't appear to be on Pypi, is it likely to be there soon? On Thursday, 18 October 2012 09:38:49 UTC+11, James Bennett wrote: > > Django 1.4.2 and 1.3.4 have just been released in response to a > security issue reported to us. > > Details are here: > > https://www.djangoproject.

Django Generic Class Based Views - Change Content-Type

2012-05-30 Thread Ross C
class based view. Anyone point me in the right direction or know the answer outright? all the best Ross -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/dj

Re: Django Deployment Statistics (via djangosites.org)

2011-01-24 Thread Ross Poulton
That was added a few months (or more?) back after some users emailed me asking me to add "wsgi" to the list. Admittedly in hindsight it's a little vague and has probably ended up being a catch-all for "wsgi: other". -- You received this message because you are subscribed to the Google Groups

Re: Django Deployment Statistics (via djangosites.org)

2011-01-24 Thread Ross Poulton
Great idea! You can now visit eg http://www.djangosites.org/stats/#serving-method if you want to deep-link to a particular chart. Thanks for the comments all! Warm Regards, Ross -- You received this message because you are subscribed to the Google Groups "Django users" group. To pos

Django Deployment Statistics (via djangosites.org)

2011-01-22 Thread Ross Poulton
yment information. I hope these statistics are useful for you. Feedback is welcome via email (r...@rossp.org) or Twitter (@RossPoulton). I would love to hear what you have to say! Cheers, Ross -- You received this message because you are subscribed to the Google Groups "Django users"

Re: URL grows in address bar with each click

2010-11-19 Thread Ross
Aha! Thanks Shawn. I'd left a forgotten "http://localhost:8000/ moreInfo" in there. I was so hung up on Django urls.py I forgot about simple html mistakes and leftovers. Thanks for the pointer! -Ross. On Nov 19, 10:16 am, Shawn Milochik wrote: > What does the "action&

URL grows in address bar with each click

2010-11-19 Thread Ross
ttp://localhost:8000/localhost:8000/localhost:8000/moreInfo Similarly other urls get appended occasionally in other situations. My searching isn't turning anything up about appended URLs or growing URLs. Does someone know what causes this and how I can just make it stop growing? Regards, Ro

Re: Halting large form-based file uploads

2010-10-14 Thread Ross
stbody). Okay - yes, I'm using apache, so I'll read up on that. Thx for the pointer... > > hth, > Jonathan -Ross. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us

Halting large form-based file uploads

2010-10-13 Thread Ross
ntil the views.py handler gets called, I assume it would tie up my service and eat up a pile of disk space as it goes past the 2.5M memory limit. I hope there is some way to avoid such a denial of service attack. Thanks, Ross. -- You received this message because you are subscribed to the Googl

Re: Generate a daily serial/batch/lot number

2010-10-07 Thread Darryl Ross
On 06/09/10 19:09, kmpm wrote: Regarding UUIDs, one of the business requirements (which I don't control) is that the identifier that is to be used on barcodes and what not is to be in the format "YYMMDD" where is the number we are talking about. So UUID would be great and unique, as well

Spammer named 'Ashley J. Sands' who harvested everyone's email from djangopeople.net

2010-05-15 Thread David Ross @ Wolfeon
Disregard the email coming from the individual and I don't recommend doing business with such a leech. This guy wrote a program to harvest emails and mass spam using Google Gmail, the access method of SMTP. How I know the guy is a leech: 1) There's no User-Agent header 2) He negligently used the

Re: Django App and Memory Mgmt

2010-05-10 Thread Ross
On May 6, 7:04 pm, Graham Dumpleton wrote: > On May 7, 4:40 am,Ross wrote: > > > I have a Django app that selects one of many possible XML documents, > > parses it with minidom.parse(), finds all elements of a certain tag > > with getElementsByTagName() then it sends

Re: Django App and Memory Mgmt

2010-05-10 Thread Ross
Thanks for that Bill. I was wondering if that was the case, as my SAX knowledge is purely anecdotal and I haven't played with it. Thanks for the summary. I'll read up on that... Ross. On May 6, 4:41 pm, Bill Freeman wrote: > You may want to consider using a sax based parsing.

Re: Django App and Memory Mgmt

2010-05-06 Thread Ross
that's a messy link :) On May 6, 3:14 pm, Javier Guerra Giraldez wrote: > On Thu, May 6, 2010 at 1:40 PM, Ross wrote: > > Your thoughts appreciated. Is there a better way?  I wouldn't want to > > stuff the XML-file resident content into a database and rebuild the > &

Django App and Memory Mgmt

2010-05-06 Thread Ross
because there are tons of files arriving and disappearing and it would become a huge background activity for another program. Ross. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegr

Re: Scammer / Job fraud rehash - Do NOT perform any business with Eike Post

2010-01-24 Thread David Ross @ Wolfeon
- I don't solicit Django on my website nor have I ever. - I don't give out this email address to people who I perform work - I give my fur name to people, not this one. - This email address is only for contact for automation with websites - Everything else is spam - I've only emailed the django mai

Scammer / Job fraud rehash - Do NOT perform any business with Eike Post

2009-12-11 Thread David Ross @ Wolfeon
you know the person and are near them to ask why they're taking so long to complete the project. Sincerely, David Ross wolfe on Freenode -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django

Re: django generic views w multiple models

2009-11-09 Thread Ross
is instance and write my own view? On Nov 8, 5:56 pm, Ross wrote: > 'm new to Django and programming in general. I'm trying to make a > simple site that allows players of a sport sign up for leagues that > have been created by the admin. In my models.py, I created two models: &g

django generic views w multiple models

2009-11-08 Thread Ross
'm new to Django and programming in general. I'm trying to make a simple site that allows players of a sport sign up for leagues that have been created by the admin. In my models.py, I created two models: `from django.db import models from django.forms import ModelForm class League(models.Model):

Re: forms vs modelforms

2009-11-03 Thread Ross
up like so: {{ object.league_name }} . My question is how to display my form so that a player can sign up for a particular league without signing up for all leagues. Did I mess up in setting up my models (in other words, should League and Info be seperate tables or one big table?) or is the proble

forms vs modelforms

2009-10-31 Thread Ross
I'm new to Django and web programming in general and I'm trying to write a simple page that will allow users to sign up for different leagues. The sign up form will have multiple fields (name, phone, address, etc). I've read over the forms documentation and the modelforms documentation, but I'm st

generic views vs writing my own

2009-10-29 Thread Ross
For which cases would a user wish to write their own views rather than using generic views? I'm new to Django and would like to build a page that prompts the user to enter information into a form to sign up for a league. Upon submitting the form, they can see the updated league roster. I'm current

poll question

2009-10-28 Thread Ross
I've gone through and successfully made the poll application and I've begun to play around and tried to change a few things. The first thing I would like to do is have the poll such that the index view still displays the name of all the different polls, but the detail view displays a field where u

generic views 404 error

2009-10-25 Thread Ross
I just neared the end of the poll application and converted everything to generic views according to the tutorial. Once I started up the server though, I could only find my admin page. I tried using the newly named urls but I keep getting Page not Found 404 errors. Same thing happens when I type i

Re: decoupled url confs- can't reach admin page now

2009-10-04 Thread Ross
ot written views for everything that the urlconf references? Because I'm struggling to find an error in any of my syntax in the urlconfs. On Oct 4, 8:51 pm, Karen Tracey wrote: > On Sun, Oct 4, 2009 at 3:39 PM, Ross wrote: > > > I was going through the tutorial and following direc

Re: decoupled url confs- can't reach admin page now

2009-10-04 Thread Ross
s'), (r'^(?P\d+)/vote/$', 'vote'), ) When I comment out the (r'^league/', include('mysite.polls.urls')), line in mysite/urls.py, I can get to the admin page. Otherwise I can't. Does this provide more insight into my problem? On Oct 4, 3:39 pm, Ross

decoupled url confs- can't reach admin page now

2009-10-04 Thread Ross
I was going through the tutorial and following directions (I think) when it instructed me to decouple the url confs near the end of part 3 of the Django Tutorial. After I did this, I was no longer able to reach the admin page. Now, whenever I try to reach the admin, I get this error message: Temp

SPAM/FRAUD WARNING: Do NOT open the email with subject "Django enquiry"

2009-08-10 Thread David Ross @ Wolfeon
I received an email a few minutes ago with the subject "Django enquiry." My email address in relation to django was phished from djangopeople or the mailing list. There is a 1x1 image contained in the email which is possibly used for verifying addresses. Don't take the spam seriously, the domain

Re: python 2.5 --> 2.3, now imagefield error

2009-07-27 Thread Darryl Ross
Cody Django wrote: > ImageFields worked just fine until I moved to a new server. Now I get > error messages "Upload a valid image". I know the images are fine, > the media root and www_url are correct, so what else could this be? > Ideas are greatly appreciated! Do you have PIL installed on the

Re: What do you think about here lambda function to configure TEMPLATE_DIRS with relatives values ?

2009-06-30 Thread Darryl Ross
Hi Stephane, I think it is a great idea. The lambda trick means I don't have to make any changes at all to switch between my development environment and production. A real life example from a current project: - from os.path import abspath, dirname, join APP_PATH = lambda *x: abspath(join(dir

django-cloudfiles

2009-06-24 Thread Ross Dakin
e the idea, hows about voting for it? http://bit.ly/ORf2q Cheers, Ross --~--~-~--~~~---~--~~ 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

decoupling urlconfs

2009-06-04 Thread Ross
I've been working my way through the Django tutorial and everything has gone fine until I came across the part near the end of section 3 about decoupling the urlconfs. I did as follows: I copied urls.py into my polls directory (C:\mysite\polls\urls.py). It now looks like this: from django.conf.ur

Re: Ignoring Definite/Indefinite Articles when Sorting

2009-05-21 Thread Darryl Ross
On 22/05/2009 12:12 PM, Sam Chuparkoff wrote: > On May 21, 10:10 pm, Darryl Ross wrote: >> I have searched around but not really found an answer to this. For a >> project I am working on the customer wants a list of publications to be >> sorted alphabetically, but

Re: Ignoring Definite/Indefinite Articles when Sorting

2009-05-21 Thread Darryl Ross
Forgot one thing, this is on Django 1.0.2. Regards Darryl On 22/05/2009 11:40 AM, Darryl Ross wrote: > Hi All, > > I have searched around but not really found an answer to this. For a > project I am working on the customer wants a list of publications to be > sorted alph

Ignoring Definite/Indefinite Articles when Sorting

2009-05-21 Thread Darryl Ross
method of doing it for MySQL: http://expressionengine.com/wiki/Sort_Entries_by_Title_Ignoring_The_A_An/ -- Darryl Ross, VK5LBJ AFOYI, Information Technology Solutions e: dar...@afoyi.com p: +61 8 7127 1831 f: +61 8 8425 9607 --~--~-~--~~~---~--~~ You received th

Re: ..... in templates

2009-04-19 Thread Darryl Ross
On 17/04/2009 11:26 PM, Christian Berg wrote: > Sorry if this sounds harsh, but it is useless to learn how to drive a > Truck, if you can't drive an car. Slightly tangential, but not true! My Grandfather learned to drive a truck in the army before learning to drive a car and failed his civilian

Re: how to organize favorites in template?

2009-04-19 Thread Darryl Ross
rg/snippets/1350/ {% for video in video_list %} {% if video.key in favorites.keys %} ... offer to remove {% endif %} {% endfor %} Regards Darryl -- Darryl Ross AFOYI, Information Technology Solutions e: dar...@afoyi.com p: +61 8 7127 1831 f: +61 8 8425 9607 --~--~-~--~~---

Re: Django Deployment Methods: Survey (via DjangoSites)

2009-04-09 Thread Ross Poulton
ues I'd assume the rest would be on shaky ground too. Cheers, Ross --~--~-~--~~~---~--~~ 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

Re: Django Deployment Methods: Survey (via DjangoSites)

2009-04-09 Thread Ross Poulton
try to access http://media.djangosites.org/ ? Sorry you've having problems - if you can provide any more information I'll see to it that it gets fixed up. Cheers, Ross --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Django Deployment Methods: Survey (via DjangoSites)

2009-04-08 Thread Ross Poulton
d those options, thank you. On Apr 7, 8:26 pm, Kenneth Gonsalves wrote: > and is there an option to remove a site? One of mine is no longer in > existence. There isn't a way on the site, sorry. Just drop me an e-mail (r...@rossp.org) and I'll delete it for you. Alternatively, you

Django Deployment Methods: Survey (via DjangoSites)

2009-04-07 Thread Ross Poulton
There are quite a few different ways to deploy Django applications so that the big wide world can see them. I'm on a mission to find out which methods are most popular, which web servers people are using, and what RDBMS is storing the data of Djangonauts world-wide. Last night I put some changes

Re: Best Convension for dealing with variables needed in every view.

2009-04-05 Thread Darryl Ross
Catching up on my mailing list folders. On 30/03/2009 10:10 AM, IanR wrote: > So if I created my own I could just add it to this list and it would > do what I need. Once my context_processor is made how would I add it > to this list? Something like > settings.TEMPLATE_CONTEXT_PROCESSORS.append(

Re: Determining server identity from views.py?

2009-03-31 Thread Ross
27;_'] doesn't exist. So I could test for the existence of underscore in the meta tags I guess. But perhaps using an enviro variable is a more elegant approach. Thx for the info... Ross. On Mar 31, 3:31 pm, Alex Gaynor wrote: > On Tue, Mar 31, 2009 at 3:29 PM, Ross wrote: &

Determining server identity from views.py?

2009-03-31 Thread Ross
Is there a means by which I can programmatically tell whether I'm running behind apache + mod_python or the django dev server? I want to do something along the lines of if dev_server: do this elif apache_mod_python: do this Thanks for any hints...

Re: Can I alter a JS file with Django

2009-03-27 Thread Ross
Excellent - that gives me new enthusiasm to keep trying. Thanks for the link too. I'll play around with mime-types to see if I can get it to work! Ross. On Mar 27, 4:07 pm, Andy Mckay wrote: > On 27-Mar-09, at 11:44 AM, Ross wrote: > > > > > > > I'm a bit

Can I alter a JS file with Django

2009-03-27 Thread Ross
x27;ve stuffed some things using template tags? Is that possible? Regards Ross. --~--~-~--~~~---~--~~ 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@

Re: mod_python and Dev server compatible coding

2009-03-24 Thread Ross
look around for something that clarifies how to use SCRIPT_NAME properly - I guess that's really what my whole question was. Any suggestions where to find examples for that? Ross. On Mar 23, 9:03 pm, Malcolm Tredinnick wrote: ...snip... > > If the dev server doesn't meet your ne

mod_python and Dev server compatible coding

2009-03-23 Thread Ross
ardly doing for now. I must be missing something here, so your help would be appreciated.. -Ross --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email t

auth.views.logout has pointless code

2009-03-21 Thread Ross Dakin
# Redirect to this page until the session has been cleared. return HttpResponseRedirect(next_page or request.path) Am I missing something? Ross --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: best way to organize models that store businesses/hours?

2009-03-16 Thread Darryl Ross
Alex Gaynor wrote: > I guess technically you could just have 14 fields on the mode(open and > close for each day of the week), which is fine since days of the week > are a static number of things but that felt bulky to me(though it's > probably more preformant). The first issue that comes to mind

Re: How to create new User with Profile in elegant way

2009-03-10 Thread Ross Dakin
ort user_activated from .models import UserProfile def create_profile(sender, **kwargs): UserProfile(user=kwargs['user']).save() user_activated.connect(create_profile) You could perhaps hook into user_registered instead, if errors pop up between the time that a user registers and

Re: Aggregating Ignores Slicing?

2009-03-03 Thread Ross
gt; > > > select sum(price) from (select price from product order by price desc > > > limit 100) as q; > > > > (That's postgres; your DB may vary.) > > > > I could be completely off-base here, as I haven't delved very far into > > > the aggr

Re: Aggregating Ignores Slicing?

2009-03-03 Thread Ross
x said. On Mar 3, 10:08 am, Alex Gaynor wrote: > On Tue, Mar 3, 2009 at 8:55 AM, Ross wrote: > > > I have started using aggregation, but it seems to ignore any slicing I > > do on a QuerySet before calling aggregate. This is what I'm doing: > > > Product.objects.ord

Aggregating Ignores Slicing?

2009-03-03 Thread Ross
I have started using aggregation, but it seems to ignore any slicing I do on a QuerySet before calling aggregate. This is what I'm doing: Product.objects.order_by("-price")[:100].values("price").aggregate(Max ("price"), Min("price")) I want the maximum and minimum price for the products with the

Prepopulate username in login form

2009-02-24 Thread Ross Dakin
Would anyone else be interested in this? http://dpaste.com/hold/1272/ Ross --~--~-~--~~~---~--~~ 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@googlegro

Re: PREPEND_WWW

2008-12-15 Thread Ross
@jmat I have never tried Django's PREPEND_WWW, but it can easily be handled by Apache. Some of the features involving URLs, paths, etc. are possibly better left to Apache. Apache has a rewrite guide that has all the information you should need. I found a good link a while ago with exactly what yo

Re: Passing values to template

2008-11-18 Thread Ross Dakin
> Others already gave you practical answers, so this will be mostly a > more general ('conceptual' ?) advice: don't mix heterogenous data > (objects, whatever) in a list. If you have a compelling reason (ie : > ordering) to have heterogenous data, wrap them all in a same 'meta' > data structure.

generic create_object field for related 'parent' object

2008-11-09 Thread Darryl Ross
Hi All, In my application I have a list of students. Each of those students has a quite a few other models related to them via a foreign key. Eg: > class Student(models.Model): > name = models.CharField(max_length=64) > surname = models.CharField(max_length=64) > dob = models.DateFie

Re: How to setup django-apache-mod_wsgi without killing existing php site?

2008-10-31 Thread Ross Dakin
h worker). Of course, proxy to Apache via nginx or alternative. Ross --~--~-~--~~~---~--~~ 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 un

Re: Different settings.py files for server and development

2008-10-24 Thread Ross Dakin
I do it like this: # settings.py [ ... ] try: from settings_dev import * except ImportError: pass # settings_dev.py import os DEBUG = True DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = 'dev.db' MEDIA_ROOT = os.path.abspath('../') + '/public/media/' MEDIA_URL = 'http://127.0.0.1:8000/med

Re: Django Hosting Survey

2008-10-08 Thread Ross Dakin
Yes, you can load balance between slices, AND you can pool your bandwidth between them (new Slicehost feature). @NoviceSortof: Yes, I am running a Hardy install with 256 MB. My typical 'top' breakdown looks like: - 55% Apache (prefork) - 10% nginx - 5% mysql - 5% postgres - 5% et al. So m

Re: Django Hosting Survey

2008-10-07 Thread Ross Dakin
nd Apache template config files, etc.). This is actually a work in progress that seems to change every time I realize there's a better way to do something than what I'm doing. Ross --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Why does Django generate HTTP 500 errors for static media when Debug is set to False?

2008-09-24 Thread Ross Dakin
Graham, I am using Apache and mod_wsgi, and I have experienced that issue before (500 errors for 404, et al.). I fixed it with some tinkering, but don't remember how. Would you mind explaining this problem a little? Thanks, Ross On Sep 23, 5:08 pm, Graham Dumpleton <[EMAIL PROTECTED

Re: javascript

2008-09-19 Thread Ross
http://docs.djangoproject.com/en/dev/howto/static-files/ The Django dev server can serve static files per the link above, but be sure to let your real web server (like Apache) handle serving static files outside development. On Sep 19, 9:03 pm, yozhik <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm

Re: IE Hell. Blank Page

2008-09-19 Thread Ross Dakin
On a related note, IE also chokes on trailing commas in arrays and such, e.g.: foo = [1, 2, 3,] --~--~-~--~~~---~--~~ 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@

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread Ross
The error looks like you are passing '1/photos/desktop.png' to int(), which converts a string to an integer. How are you creating the link to the picture? Your urls.py could be capturing that entire string and passing it as a parameter that you are trying to cast to an integer. A bigger stack tr

Re: Chaining custom filter methods

2008-09-17 Thread Ross
I am going to try to connect my Django app to several different databases, so I found this discussion talking about it: http://groups.google.com/group/django-developers/browse_thread/thread/9f0353fe0682b73 The very first post mentions how to define a custom get_query_set function, though it is r

Re: Inconsistent urlresolver errors

2008-09-15 Thread Ross
Can you paste the urls.py from your project as well as the one from the app you are having problems with? On Sep 15, 11:00 pm, catsclaw <[EMAIL PROTECTED]> wrote: > On Sep 15, 10:51 pm, Ross <[EMAIL PROTECTED]> wrote: > > > You can always fall back to {% url myapp.u

Re: Get times of day with most entries

2008-09-15 Thread Ross
http://graphite.wikidot.com/ Graphite is a very cool open source graphing utility that was actually written purely in Python and Django. It has its own persistence back end, so you would actually have very little work to do for what it sounds like you are trying to do. There's no sense in reinve

Re: Inconsistent urlresolver errors

2008-09-15 Thread Ross
You can always fall back to {% url myapp.users.login %} unless you need to reuse a view but have several different URL patterns for it. On Sep 15, 6:39 pm, catsclaw <[EMAIL PROTECTED]> wrote: > On Sep 15, 5:53 pm, Ross <[EMAIL PROTECTED]> wrote: > > > Are you usin

Re: restart apache every time I make a modification?

2008-09-15 Thread Ross
There was a thread on this a couple days ago that I starred. Here ya go: http://groups.google.com/group/django-users/browse_thread/thread/f44eefb21b7e675c# On Sep 15, 10:27 pm, Cequiel <[EMAIL PROTECTED]> wrote: > Hi all. > > I installed Django with Apache in my Windows. It was a little > compli

Re: Problem with url tag (Caught an exception while rendering: Reverse ...)

2008-09-15 Thread Ross
Check out the description of the {% url %} tag in the Django documentation: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#url It does not expect the project name to be in the URL. Try dropping "gpp" and just use "weblinks.views.view_links". On Sep 15, 9:19 pm, Brian Neal <[EMAIL

Re: Inconsistent urlresolver errors

2008-09-15 Thread Ross
Are you using Django 1.0? URL naming patterns (http:// docs.djangoproject.com/en/dev/topics/http/urls/#id2) were not introduced until 1.0. From the looks of the exception, Django is trying to build the path to your view by appending the argument in the {% url %} tag to your app name. python manag

Re: How to render a static html page and keep processing after?

2008-09-15 Thread Ross
> A web server itself is not a good place to do > long-running work that isn't being served directly to a browser. I agree with Ned on this one. If there is some intensive work that needs to be done, it would best be done by a process separate from the web server. The web server should write what

Re: Deleting and creating a model

2008-09-13 Thread Ross
I think you would either have to assign the antenna's phone: antenna.phone = phone or refetch the antenna from the database so Django creates the object with the newly-created reference. The antenna you are looking at is only coming from memory when you do antenna.phone, not from the database. Y

Re: Database Security

2008-09-13 Thread Ross
http://docs.djangoproject.com/en/dev/ref/databases/#connecting-to-the-database Putting your database in the DMZ is probably a very bad idea... You don't want to give the entire internet access to your database. The standard Django setup expects your database to be accessible on the same local net

Re: How to prevent URL HTML encoding?

2008-09-13 Thread Ross
e help by the way! I am going to go with the optional slash in my regexs to get around APPEND_SLASH. On Sep 13, 1:25 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Sat, Sep 13, 2008 at 1:36 AM, Ross <[EMAIL PROTECTED]> wrote: > > > The URL encoding

Re: How to prevent URL HTML encoding?

2008-09-12 Thread Ross
I was just hoping there was an option to do just that. On Sep 12, 10:15 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Fri, Sep 12, 2008 at 6:06 PM, Ross <[EMAIL PROTECTED]> wrote: > > > The problem is it looks bad! It makes the URL unreadable, which is >

Re: How to prevent URL HTML encoding?

2008-09-12 Thread Ross
t.fm/music/Goo%2BGoo%2BDolls, however, is far tougher to pick apart by a human reader. My short answer is I want to keep my URLs human readable. On Sep 12, 1:14 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Fri, Sep 12, 2008 at 1:49 PM, Ross <[EMAIL PROTECTED]&g

Re: How to prevent URL HTML encoding?

2008-09-12 Thread Ross
27;+' when it gets to the view. Even if '+' is meant to be a space in URL-speak, it conveys the right meaning for what I am trying to do. Is it possible to prevent APPEND_SLASH from percent encoding URLs? On Sep 12, 12:08 pm, "Karen Tracey" <[EMAIL PROTECTED]&

Re: How to prevent URL HTML encoding?

2008-09-12 Thread Ross
Sorry, Julian, I misunderstood what you wrote. I see the Django HTML escaping doesn't change the '+' symbol, which makes this even more confusing... Even more strangely, this only happens intermittently. On Sep 12, 11:04 am, julianb <[EMAIL PROTECTED]> wrote: > On Sep 12, 4:22 pm, "Norman Harman"

  1   2   >