Re: Query help

2021-09-20 Thread Sean Collins
Add a property to count Y for each column Or add a computed field that tallies that on save For reference https://stackoverflow.com/questions/1454727/do-properties-work-on-django-model-fields On Mon, Sep 20, 2021 at 6:41 PM J.T. wrote: > I have a model called member that has 6 columns: ID,

Re: htmx: Has someone already tried this tiny JS library?

2020-08-27 Thread sean li
I personally perfer art template js for loading part of the page without jumping to another url. the links as below. http://aui.github.io/art-template/ But you still need to serialize your data to send it to frontend. guettli 于 2020年8月27日周四 上午6:57写道: > Today I found htmx a

ASGI alongside mod_wsgi behind an Nginx proxy

2017-09-22 Thread Sean F
;text": 'You said %s' % (message.content['text'],), }) Like I said, this all works great when I serve the entire project from Daphne, but I want mod_wsgi to serve HTTP stuff, as the docs suggest is possible. What am I doing wrong here? Thanks for reading this far, Sean -- You re

django.contrib apps migrations

2016-05-12 Thread Sean McKinley
Django 1.7+ noob here. Are you supposed to to track the migrations performed within the django.contrib apps? How do you deploy to production on a different machine without grabbing these migrations from the django installation? -- You received this message because you are subscribed to the

Re: installation steps for django and virtualenv setup.

2016-05-12 Thread Sean McKinley
Download Python of choice. Pip install virtualenv. Pip install Django. Use google. On Thursday, April 7, 2016 at 8:28:53 AM UTC-7, srinivas tummalapalli wrote: > > Hi santosh,i installed oracle VM virtual box and linux mint, can send the > installation steps for django and virtualenv setup. >

Re: 1.8 or 1.9?

2016-05-12 Thread Sean McKinley
I haven't taken the course, but the differences between basic Django 1.8 and 1.9 are not all that significant and you can find out if you are being taught something odd by reviewing 1.9 release notes. Big caveat, syncdb is gone in 1.9 so you have to learn migrations if the Udemy course is using

Re: Translation is not working for Template even though po and mo files are created

2015-11-01 Thread Sean Xu
be ~/django-swingtime/django-swingtime-master/demo/karate. Br Sean On Sunday, November 1, 2015 at 6:09:02 PM UTC+8, Andréas Kühne wrote: > > Hi Sean, > > That's interesting. You shouldn't have to add the locale paths explicitly. > Good that it's wokring, but as long as you put t

Re: Translation is not working for Template even though po and mo files are created

2015-10-31 Thread Sean Xu
/demo> python manage.py runserver ') It's weird demo was not recognized while swingtime was recognized for translation, though. Br Sean On Friday, October 30, 2015 at 9:47:53 PM UTC+8, Andréas Kühne wrote: > > Hmmm > > I'm a bit at a loss here. But does Django know where to find t

Re: Translation is not working on ModelForm when widget is specified for form field

2015-10-30 Thread Sean Xu
et, > 'end_time': SplitDateTimeWidget, > } > > That way you don't have to add the labels once more, but just use them > from the model instead. > > Regards, > > Andréas > > 2015-10-30 7:21 GMT+01:00 Sean Xu <seanx...@gmail.com >: > >> Hi, >&

Re: Translation is not working for Template even though po and mo files are created

2015-10-30 Thread Sean Xu
django.template.context_processors.i18n should really be django.core.context_processors.i18n). But unfortunately the translation for my template still does not work :( On Friday, October 30, 2015 at 7:27:36 PM UTC+8, Sean Xu wrote: > > Hi Andréas, > > Thanks very much for providing the help. > Currently the mid

Re: Translation is not working for Template even though po and mo files are created

2015-10-30 Thread Sean Xu
need to add this i18n context processor to settings.py? Br Sean On Friday, October 30, 2015 at 6:07:21 PM UTC+8, Andréas Kühne wrote: > > Hi, > > Have you made sure that you have activated the languages you want in your > application? > Also, how is the current language bei

Translation is not working on ModelForm when widget is specified for form field

2015-10-30 Thread Sean Xu
if these 2 lines get removed #=== class Meta: model = Occurrence if FIELDS_REQUIRED: fields = "__all__" Br Sean -- You received this message because you are subscribed to

Translation is not working for Template even though po and mo files are created

2015-10-30 Thread Sean Xu
return render(request, template, {'occurrence': occurrence, 'form': form }) And the url configuration associated with the Template reads: url( r'^events/(\d+)/(\d+)/$', views.occurrence_view, name='swingtime-occurrence' ), Could some one help me solve this pr

Testing Migrations (django 1.7)?

2015-03-16 Thread Sean Briceland
Hi all, Previous to Django 1.7, I had a nifty solution for testing south Migrations. I'd basically get a list of migrations for an app via: migrations = Migrations('some_app') Then to get the ORM at a given point in migrations: orm_at_migration = migrations['000X_name_of_migration'].orm() I

Re: Is there anyone whos used Django with webfaction that has made there own tutorial ?

2015-02-15 Thread Sean Fulmer
On Saturday, February 14, 2015 at 2:11:50 PM UTC-7, djangocharm2020 wrote: > > seem to be having issues with it one question if anyone has if you make a > new project from scratch do you still need to use the virtualenv to create > a project > No, you don't need to use virtualenv with

Re: Django newbie frustrated

2014-02-12 Thread Sean Luke
It gives me an error saying unresolved reference. I will try the django tutorial. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: Django newbie frustrated

2014-02-12 Thread Sean Luke
models.py from django.db import models # Create your models here. class Poll(models.Model): question = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') class Choice(models.Model): poll = models.ForeignKey(Poll) choice =

Re: Django newbie frustrated

2014-02-12 Thread Sean Luke
M UTC-6, Lucas Klassmann wrote: > > Hi Sean! > > You has added *polls* inside of *INSTALLED_APPS* in the *settings.py*? > > You can show me other source files? > > Greetings > > > On Wed, Feb 12, 2014 at 5:13 PM, Sean Luke <192.se...@gmail.com > &

Re: Output of form in Extjs

2013-12-16 Thread Sean
Hi JJ, I am very interested in the django form output in ExtJS style, has your code been upload somewhere I can have a look, such as github? Also, my email address is liushu2...@gmail.com Thanks, Sean On Tuesday, 4 September 2012 20:05:01 UTC+1, JJ wrote: > > Hi all, > I created par

Django for corporate web site

2013-08-05 Thread sean chen
://www.djangopackages.com/grids/g/ecommerce/, is there a focus area for corporate websites? Thanks, Sean -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email

Re: Avoiding huge IDs after deleting data

2013-08-05 Thread Sean Whalen
Giraldez <jav...@guerrag.com>wrote: > On Mon, Aug 5, 2013 at 4:26 PM, Sean Whalen <whalens...@gmail.com> wrote: > > However, because the Django ORM uses the SERIAL data type to store the > IDs > > in the DB; the IDs get larger, even when all existing records have b

Avoiding huge IDs after deleting data

2013-08-05 Thread Sean Whalen
I have a Django/PostgreSQL application to analyze data from tweets. The dataset increases by thousands of records with each request. I am using the database primarily as a relational cache, so I had planned to delete all records every 24 hours to permit new requests, without needlessly

Announcing DjangoNYC Office Hours

2012-09-29 Thread Sean O'Connor
. Thanks! Sean O'Connor http://seanoc.com -- 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/django-users/-/FpF0cRXZtg8J. To post to

Re: Choosing a Django-based CMS

2012-08-06 Thread Sean O'Brian
Thanks all. As I get, I should try both Mezzazine and FeinCMS. May be they're have another advantages and disadvantages. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Choosing a Django-based CMS

2012-08-05 Thread Sean O'Brian
Hi! I'm using Django CMS for a few of weeks and I like it. But there's one problem, which I already ran into: I can't extend Page model easily. I found one tutorial, but this not seem to be very developer-friendly and author said that it's

DjangoCon US CfP Closes Tomorrow

2012-06-15 Thread Sean O'Connor
please feel free to let me know at s...@seanoc.com. Thanks! -- Sean O'Connor http://www.seanoc.com -- 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 unsubscribe from

DjangoCon US Accepting Talk and Tutorial Proposals

2012-05-29 Thread Sean O'Connor
or run into any problems, please let me know at s...@seanoc.com. Thanks! Sean O'Connor DjangoCon US Community Chair -- 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/

GeoDjango and pyspatialite

2011-08-10 Thread Sean
tried changing the base.py for the spatialite base.py in contrib.gis to look for the sqlite3 library but that didn't work. I'm sure it's a bad idea anyway to have it load the sqlite3 lib again. Has anyone found a way to get GeoDjango to pyspatialite? Thanks, Sean -- You received this message

Re: Want to give a talk at Djangocon, the time to submit is now

2011-06-22 Thread Sean O'Connor
and I'm sure other organizers would be happy to provide guidance and support in what ever ways we can. -- Sean O'Connor http://www.seanoc.com On Wednesday, June 22, 2011 at 12:15 PM, Addy Yeow wrote: > Any plan to host Djangcon in Asia? > > On Thu, Jun 23, 2011 at 12:08 AM, Sean

Want to give a talk at Djangocon, the time to submit is now

2011-06-22 Thread Sean O'Connor
at this year's Djangocon, you need to get your proposal in ASAP. You can read more about submitting a proposal at http://djangocon.us/blog/2011/06/22/call-papers/ and feel free to contact me directly if you have any questions or concerns. -Sean O'Connor s...@seanoc.com -- You received

Re: Annotate with a filtered Count

2011-05-25 Thread Sean McArthur
I would be very interested to know if there is a way to do this using Django's Aggregation API. For now, the only solution I can come up with is having to use a fat .extra() call. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Encrpting urls to hide PKs

2011-05-10 Thread Sean Brant
On May 10, 2011, at 4:02 PM, "Cal Leeming [Simplicity Media Ltd]"<cal.leem...@simplicitymedialtd.co.uk> wrote: > Sean, are you suggesting that the OP rely on base36 encoding for security? > Please tell me you are joking. No not at all, I thought he stated this does

Re: Encrpting urls to hide PKs

2011-05-10 Thread Sean Brant
Sorry I think I only responded to the original poster. >>> from django.utils.http import int_to_base36, base36_to_int >>> int_to_base36(123) '3f' >>> base36_to_int('3f') 123 Sean -- You received this message because you are subscribed to the G

Re: How should I properly impliment HTTP(S) auth (REMOTE_AUTH) in django?

2011-02-09 Thread Sean W
ver https. We use the basic authentication > included with django-piston. > > Any reason why you want to exchange username and password for an API Key? > Why not just authenticate each request with username and password? > > > > On Feb 8, 2011, at 5:37 PM, Sean W wrote:

Re: How should I properly impliment HTTP(S) auth (REMOTE_AUTH) in django?

2011-02-09 Thread Sean W
c is over https. We use the basic authentication > included with django-piston. > > Any reason why you want to exchange username and password for an API Key? > Why not just authenticate each request with username and password? > > > > On Feb 8, 2011, at 5:37 PM, Sean W w

How should I properly impliment HTTP(S) auth (REMOTE_AUTH) in django?

2011-02-08 Thread Sean W
This is a re-post of my stack overflow question here http://stackoverflow.com/questions/4939908/how-should-i-properly-impliment-https-auth-remote-auth-in-django Hi, I am in the planning phase a new project. I want to be able to control multiple relays from my android powered phone over the

Re: Can someone help with Many-to-many referencing and then calculations against another field on the linked model

2011-01-21 Thread Sean Wallace
you should get rid of it. and > self.fringe_total = self.fringe_value > should be: self.fringe_total = self.fringe_value() I'm not sure if that'll make the whole thing work, but it will fix the error you received. You have to call the method somewhere along the line or it won't get executed

Converting from Wordpress, upgrading users.

2011-01-15 Thread Sean Brant
I am migrating a site from Wordpress to Django and I need the old username and passwords to keep working. I first create auth.User objects for all Wordpress users. Wordpress' login username does not conform to Django's so I need to fix some of the usernames during migration. I then store

Re: Need HELP urgently

2011-01-13 Thread Sean Wallace
am able to add from backend, > > > > Thanks The time gap is created because Django is trying to generate a select input with 200,000 options in it. I'd recommend choosing another widget type, probably an autocomplete of some sort... http://docs.djangoproject.com/en/dev/ref/contrib

Re: Django training resources?

2010-12-17 Thread Sean W
I should mention that a would prefer a tutorial that goes over web development principals like Javascript and AJAX because I've never used those tools before. Thanks again. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Django training resources?

2010-12-17 Thread Sean
USA On Dec 17, 2010 9:28 PM, "Kenneth Gonsalves" <law...@au-kbc.org> wrote: > On Fri, 2010-12-17 at 15:12 -0800, Sean W wrote: >> Is anyone aware of good quality, affordable training for Django? > > which country? > -- > regards > Kenneth Gonsalves > &

Django training resources?

2010-12-17 Thread Sean W
Is anyone aware of good quality, affordable training for Django? I'm entirely new to web development, although I do have some experience with Python. I'm also a college student, so cost is a concern. I don't have the time to travel to a training seminar. I'm not one of those people who can

Re: Wiki in Django?

2010-09-11 Thread Sean W
After a bit of googling I found: https://code.google.com/p/sct-project/ On Sep 11, 12:47 pm, Shamail Tayyab wrote: > Hi, > >   I need a very minimal wiki, best if it runs on flat files. moinmoin is too > heavy for what I am looking. Is there some Django thing available or

Admin Inline inside another admin inline

2010-07-03 Thread Sean Brant
I have these models and model admins and I was hoping inlines = [] inside a admin.TabularInline would work, but it doesn't seem to. class Size(models.Model): pass class Product(models.Model): pass class ProductType(models.Model):

SQL along side NoSQL

2010-06-02 Thread Sean Brant
Whats the best way to use django's orm along side a NoSQL DB? I want to keep my users and other data in postgres but have some data that would be better suited for a NoSQL DB like redis. I see a lot of talk about switching to NoSQL but little talk on integrating it with existing systems. I think

Re: Python 2.6 Decompile --- I lost my views.py but have the views.pyc

2009-12-17 Thread Sean Perry
On Thu Dec 17 11:28 , Bill Freeman sent: >I saw a demo of a byte code disassembler once. It won't get you the >source code back, but you could conceivably construct equivalent from >it. You can, for example, see what it's calling, and sketch out the >contiditionals and any loops. You could

Re: Sick of defining urls

2009-12-03 Thread Sean Perry
On Thu Dec 3 8:42 , Todd Blanchard sent: > >I've read the little poem. I disagree with about half of it. If you can't >take constructive criticism of your toolkit (I have plenty negative to say about rails and any of the other dozen web app development environments I

middleware to log request/response objects for testing purposes?

2009-11-25 Thread Sean Neilan
Dear Django Community, I am curious if anyone has built some middleware to log all request/ response objects & possibly view & exception calls. I could do this myself easily, but, I would like to not reinvent the wheel. Thank you for your time. -Sean Neilan -- You received this

Re: Switching a Models Field Class at Runtime

2009-11-12 Thread Sean Brant
for writing, I can do all my reads from a base model. Sean -- 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...@googlegroups.com. To unsubscribe from this group, send email to django-user

Switching a Models Field Class at Runtime

2009-11-12 Thread Sean Brant
the time to read this over. - Sean -- 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...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@google

Sessions for Anonymous Users

2009-11-05 Thread Sean Brant
So I have a invite system for one of my projects and right now when a user clicks the link /invitations// I get the invitation object and store it in request.session['invitation']. Then I redirect to / accounts/new/ if request.session['invitation'] is None then I produce and error if not I

Re: Marking usernames as not for use dynamically

2009-11-02 Thread Sean Brant
Thanks Ethan. bruno you are right moving stuff under the /profiles/ namespace would solve everything. Moving the pattern last but allowing users to still create the username of "login" would prevent there username from working. You are also right about "whenever you add any other url..." this

Marking usernames as not for use dynamically

2009-11-02 Thread Sean Brant
a username. Although I'm not sure how expensive that will be. I'd rather not have to maintain a list in my settings file. Anyone know of a solution for this? Seems like a fairly common use case. Sean --~--~-~--~~~---~--~~ You received this message because you

October's Django-NYC Meeting

2009-09-29 Thread Sean
220, in Brooklyn at 7pm on 10/13/09. We look forward to seeing you there! -Sean --~--~-~--~~~---~--~~ 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@google

Re: Any one knows equivalent non php plugin for this?

2009-09-28 Thread Sean Perry
On Mon Sep 28 15:04 , ydjango sent: > >http://www.frontpageslideshow.net/ > > >Anyone knows equivalent plugin of above which I can use in python/ >django site. > >The plugin above is in jquery and php. Most of the magic is in the javascript (they use jQuery) and CSS,

Re: Permissions per model instance

2009-09-10 Thread Sean Kemplay
profile, and retrieve the instance through it. eg account.domain_set.get(). If it throws an error, it doesnt exist or isnt owned by that account. This stops url manipulation as far as I can tell. Sean On Wed, 2009-09-09 at 16:37 -0700, eka wrote: > Hi all.. > > Is there any way

Re: Restricting database permissions

2009-09-07 Thread sean
Hi Thomas, Thank you for your suggestion. The modified manage.py sounds like a very good place for me to start. Best regards, Sean On Mon, 2009-09-07 at 16:09 +0200, Thomas Guettler wrote: > I can speak only for postgres. > > We create the database with a special admi

Restricting database permissions

2009-09-07 Thread sean
with one user, what is the best way to restrict it's permissions to the ones I want it to be able to read? Can this be done at a configuration file level so that upon running syncb, the permissions are in place? Any pointers greatly appreciated. Regards, Sean

Re: The admin interface - this used to work?

2009-08-18 Thread Sean Kemplay
I had a similar problem after updating the django version. I had custom admin templates based on the previous version. Copying the latest versions accross fixed it for me. Regards, Sean On Tue, 2009-08-18 at 07:18 -0700, Joakim Hove wrote: > Hello, > > I am slowly building

Testing code that uses geopy

2009-08-10 Thread Sean Brant
I have written some unit tests that test various parts of code that utilize geopy for determining geo locations. Should I be running my tests using the geocoder class, or should I create a mock class that does not actually ping any services? If creating a mock class is recommended should I

Re: Touch django.wsgi not reloading daemon

2009-08-05 Thread Sean Kemplay
behind by apt and all is now fine. I did notice in my apache logs that mod_wsgi was compiled against python 2.5.1 and that python 2.5.2 was installed on my system - I am not sure if that contributed. The config files needed no change. Thanks, Sean On Aug 5, 10:20 pm, Graham Dumpleton

Re: Touch django.wsgi not reloading daemon

2009-08-05 Thread Sean Kemplay
Hi all. I have resolved this by adding user=www-data group=www-data to the WSGIDaemonProcess: WSGIDaemonProcess sean75_ispy user=www-data group=www-data Regards, Sean On Aug 5, 1:46 pm, Sean Kemplay <sean.kemp...@gmail.com> wrote: > Hi All, > > I have the following in my virt

Touch django.wsgi not reloading daemon

2009-08-05 Thread Sean Kemplay
up. Has anyone else experienced this? Regards, Sean --~--~-~--~~~---~--~~ 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 unsubs

Inserting into existing tables

2009-08-04 Thread Sean Brown
I have existing tables in a postgresql database created with existing sequences as the default values for their primary key. I am trying to interface with the database with django (i have tried with 1.0.2, 1.1 and now have django-trunk) and while it seems the model works (runserver

QuerySet question, getting latest 3 objects filtered by a key.

2009-06-22 Thread Sean Brant
This is best explained with an example. i have a model for Stats class Stat(models.Model): key = models.CharField(max_length=50) value = models.TextField() pub_date = models.DateTimeField() so if i create a few stat objects lets say these. stat1 = Stat(key='total_books_sold',

Dual Storage Backends?

2009-06-18 Thread Sean Brant
has anyone come across dual storage backend, ideally id would like a way to save a file locally and then in a back ground process save to s3, the guess the storage class would handle the files locally until the background process has finished then switch to serving the files off of s3? Basecamp

Re: Images not uploading in the admin tool

2009-06-17 Thread Sean Brant
Nope, there customer support takes to long so I just gave up. Please post if you have any updates. Last I remember it might be a NFS issue on there end. Not really sure. On Jun 17, 2009, at 9:43 AM, mmarshall <matt...@matthewmarshall.org> wrote: > > On Jun 9, 9:19 am, Sean Br

Re: Is there a way to calling a model field method on model save

2009-06-16 Thread Sean Brant
Okay I just came up with this, let me know if this is a really hacky way to do this. With this it will save the model, then the file and then the model again, not sure how to do this since we don't get the filename until after we save the file and we have to set the filename in the database.

Is there a way to calling a model field method on model save

2009-06-16 Thread Sean Brant
I am creating a custom image field, that I would like for it not to save the image until after the model instance is written to the database (i want the id for the object to use in the filename). The ImageField class saves the image to storage via pre_save. Is there any methods or any other code

Re: Problem with query set order_by

2009-06-11 Thread Sean Brant
You the man Alex, that was the problem! On Jun 11, 11:19 am, Alex Gaynor <alex.gay...@gmail.com> wrote: > On Thu, Jun 11, 2009 at 11:15 AM, Tom Evans <tevans...@googlemail.com>wrote: > > > > > > > On Thu, 2009-06-11 at 09:04 -0700, Sean Brant wrote: > >

Problem with query set order_by

2009-06-11 Thread Sean Brant
If I have 2 sql queries one with a limit of 5 and the other with a limit or 6 they return there results in diffrent orders. Here is a example. >>> class Book(models.Model): >>>title = models.CharField(max_length=150) >>>author = models.CharField(max_length=100) >>> book_list_1 =

Re: Images not uploading in the admin tool

2009-06-09 Thread Sean Brant
reach back out to them and see what they say. On Tue, Jun 9, 2009 at 9:15 AM, Karen Tracey<kmtra...@gmail.com> wrote: > On Tue, Jun 9, 2009 at 9:49 AM, Sean Brant <brant.s...@gmail.com> wrote: >> >> I am running on a MediaTemple Django container with the SVN version of >

Images not uploading in the admin tool

2009-06-09 Thread Sean Brant
o to this degree. I suspect it might be a server issue though? This code however worked for a while then just stopped, and there were no code changes that took place when It stopped working. Thanks Sean --~--~-~--~~~---~--~~ You received this message because yo

Re: UnicodeEncodeError

2009-05-21 Thread Sean Brant
Thanks Karen. This is a script that fetched some json from a remote service. I switched from using the normal simplejson module to the one provided by Django and that seems to decode things in a unicode safe way. On May 21, 2009, at 8:48 AM, Karen Tracey wrote: > I see

UnicodeEncodeError

2009-05-20 Thread Sean Brant
Traceback (most recent call last): File "manage.py", line 11, in ? execute_manager(settings) File "/home/58124/data/python/django/django/core/management/ __init__.py", line 362, in execute_manager utility.execute() File "/home/58124/data/python/django/django/core/management/

Re: Trying to access admin but getting AttributeError: 'NoneType' object has no attribute 'cursor'

2009-05-15 Thread Sean Brant
I rechecked out trunk and it seems to work as expected. Thanks. On May 15, 2009, at 10:54 PM, Alex Gaynor <alex.gay...@gmail.com> wrote: > > > On Fri, May 15, 2009 at 8:40 PM, Sean Brant <brant.s...@gmail.com> > wrote: > > On more thing I reverted back to rev: 9

Re: Trying to access admin but getting AttributeError: 'NoneType' object has no attribute 'cursor'

2009-05-15 Thread Sean Brant
On more thing I reverted back to rev: 9500 (choose it randomly) every thing seems to work. On May 15, 8:24 pm, Sean Brant <brant.s...@gmail.com> wrote: > Im running trunk rev: 10790 with Postgres 8.3 and when I access the > admin area or when using login_required i get this error: &

Re: Trying to access admin but getting AttributeError: 'NoneType' object has no attribute 'cursor'

2009-05-15 Thread Sean Brant
It might be due to threading, every once in a while I can pull up the admin page. It's pretty random thought. On May 15, 8:24 pm, Sean Brant <brant.s...@gmail.com> wrote: > Im running trunk rev: 10790 with Postgres 8.3 and when I access the > admin area or when using login_re

Trying to access admin but getting AttributeError: 'NoneType' object has no attribute 'cursor'

2009-05-15 Thread Sean Brant
Im running trunk rev: 10790 with Postgres 8.3 and when I access the admin area or when using login_required i get this error: Traceback (most recent call last): File "/Users/seanbrant/webapps/django/lib/python2.5/django/core/ servers/basehttp.py", line 278, in run self.result =

Re: django.contrib.auth tests fail

2009-05-13 Thread Sean Brant
I am also having a issue with contrib.auth test errors. They errors seem to be caused by url tags in my base.html template. When I comment out all of those tags the tests pass. The url tags seem to work when i look at the site im my browser.

Re: Help a noob with a stupid question - forms

2009-05-12 Thread Sean Brant
could overcome this > problem since, at least in my opinion, the calendar widget might be a > little confusing. > > Thanks for the suggestion. > > On May 12, 7:56 am, Sean Brant <brant.s...@gmail.com> wrote: > > > Did you try date = models.DateTimeField(). This will sh

Re: Help a noob with a stupid question - forms

2009-05-12 Thread Sean Brant
Did you try date = models.DateTimeField(). This will show up in the admin tool as a calendar widget that you can use to select the date. Django takes care of converting the dates into Python objects and into whatever format your database needs for storing. You could also just use a DateField if

Re: ModelForm customizing

2009-05-08 Thread Sean Brant
Try this, not tested but it might work. class ProfileForm(forms.ModelForm): def __init__(self, *args, **kwargs): self.error_class = DivErrorList super(ProfileForm, self).__init__(*args, **kwargs) class Meta: model = P exclude = ('date', 'user', 'public')

Re: Template tags and variables overlapping

2009-04-30 Thread Sean Brant
If the tag excepts more than one argument you should be able to do something like this. {% sayHello "Robert and" currentname %} You would just need to figure out how best to break the bits up (a regex probably would work) and iterate over those bits resolving the variables to strings, keeping

Re: request.urlconf does not get used in URL template tag

2009-04-15 Thread Sean Brant
I knew I couldn't be that easy. Thanks for the heads up. Any other work around? besides the patch mentioned. On Apr 15, 11:17 pm, Alex Gaynor <alex.gay...@gmail.com> wrote: > On Thu, Apr 16, 2009 at 12:15 AM, Sean Brant <brant.s...@gmail.com> wrote: > > > If you se

request.urlconf does not get used in URL template tag

2009-04-15 Thread Sean Brant
If you set request.urlconf in say a Middleware then the reverse function and the url tag will not work because those try to match based on your ROOT_URLCONF. I was trying to find a solution to this problem and came across this ticket. http://code.djangoproject.com/ticket/5034 Then It dawned on

Setting and deleting cache keys with tags

2009-04-13 Thread Sean Brant
-with-tags/ My question to the group is??? Is there a common use-case for this? and should I submit a ticket and see if this or an approach similar is worth including into trunk? Thank, Sean --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Business Logic Architecture Questions on Models & ModelManagers

2009-04-12 Thread Sean Neilan
be a bit better off now. Thank you again. -Sean On Apr 12, 11:16 pm, Malcolm Tredinnick <malc...@pointy-stick.com> wrote: > On Sun, 2009-04-12 at 20:41 -0700, Sean Neilan wrote: > > I'm building a large web application & I'm trying to figure out ways > > to organiz

Business Logic Architecture Questions on Models & ModelManagers

2009-04-12 Thread Sean Neilan
time. --Sean Neilan http://seanneilan.com --~--~-~--~~~---~--~~ 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 unsubscribe from this gro

Re: Django wont display images on my CSS file

2009-03-27 Thread Sean Brant
In most of my projects I have a img, css, js folder. In my css file I reference images like this url(../img/path/to/img.jpg) in my css files. The ../ basically says start the path back one directory. Not sure if this is what's causing your problem. On Mar 27, 8:10 am, Martin Ostrovsky

Faster Database?

2009-02-25 Thread Sean
are almost the most powerful machin I can get in the market, so hardware is not a issue. I guess the slow down is caused by I/O to hard-disk. Anyone have any suggestion how can I make this process faster, or there is any other superfast database engine than MySql? Sean

Re: select_related() and reverse foreign keys -OR- how to I get a blog post and its comments?

2009-02-24 Thread Sean Patrick Hogan
'll follow it. Maybe someone here has a better idea. Sean. On Mon, Feb 23, 2009 at 6:11 PM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Mon, 2009-02-23 at 21:49 +0100, Torsten Bronger wrote: > > Hallöchen! > > > > Alex Gaynor writes: > > &

Re: select_related() and reverse foreign keys -OR- how to I get a blog post and its comments?

2009-02-23 Thread Sean Patrick Hogan
than having that error message pass silently. Errors should never pass silently. Unless explicitly silenced. ~Zen of Python Well, I guess I have a project for this week! Sean. On Mon, Feb 23, 2009 at 3:55 PM, Alex Gaynor <alex.gay...@gmail.com> wrote: > > > On Mon, Feb 23,

Re: Problem outputting date in template as timestamp

2009-02-21 Thread Sean Brant
BTW, That is with a timezone of "America/New_York" On Feb 21, 1:05 pm, Sean Brant <brant.s...@gmail.com> wrote: > Would something like this work? > > def U(self): >     "Seconds since the Unix epoch (January 1 1970 00:00:00 GMT)" >     import c

Re: Problem outputting date in template as timestamp

2009-02-21 Thread Sean Brant
Would something like this work? def U(self): "Seconds since the Unix epoch (January 1 1970 00:00:00 GMT)" import calendar timestamp = calendar.timegm(self.data.timetuple()) return timestamp + time.timezone Test: r""" >>> print dateformat.format(my_birthday, 'U') 40437 """

Re: Problem outputting date in template as timestamp

2009-02-20 Thread Sean Brant
> I asked a similar question a while ago... turns out the server i'm > using from godaddy was set for Arizona and was an additional 20 some > minutes off... I checked my server and the timezone is set to US/CENTRAL and my settings file is set to America/Chicago. So that should be the same. Plus

Problem outputting date in template as timestamp

2009-02-20 Thread Sean Brant
I am trying to render a timestamp in my template with date:"U" but the timestamps are days off. I wrote up a simple test case that fails. Do you think this is a bug or a user error? I am running rev: 9846. from django.test import TestCase class SimpleTest(TestCase): def

Re: Query that grabs objects before and after object

2009-02-19 Thread Sean Brant
> current_show = 5 #Presumably you get this in your request > show_range = (current_show - 4, current_show + 4) > shows = Show.objects.filter(show_order__range=show_range) This seems to work so far. shows = Show.objects.filter(Q(pk__range=(show_id - 4, show_id + 4) & Q (category=category))

Query that grabs objects before and after object

2009-02-18 Thread Sean Brant
Is there a simple way to say get me 4 objects from model that come before this object and 4 that come after this object. So lets say I have a Show. I would like to know which 4 shows come before the current show and which 4 come after, however I must limit the shows based on a category type.

Re: Svn pre-commit hooks with beanstalkapp.com

2009-02-15 Thread Sean Brant
In case anyone else in interested I whipped up this simple script that seems to do the job. http://dpaste.com/121117/ It basically works like svn commit but looks thru all of directories under your current directory for manage.py files. If it finds one it runs manage.py test. If all tests pass

  1   2   3   >