Re: Problem on user profile

2011-09-28 Thread Thomas Orozco
You might be importing your models.py file multiple time, thus registering the signals multiple times. You should look into the signals documentation - you can avoid duplicate signal handlers and this is covered there. Le 28 sept. 2011 14:44, "Lingfeng Xiong" a écrit : -- You received this mess

Re: Community Wiki/CMS app

2011-09-28 Thread Thomas Guettler
little too much, try out Django-cms: > https://www.django-cms.org/ Have you every used Pinax? I looked at the mailing list Maybe I am wrong, but I can't see a healthy community there. Same here: nearly no code changes in the last weeks: https://github.com/pinax/pinax/commits/master

Re: Looking for a job in the Arctic Circle

2011-09-30 Thread Thomas Weholt
Ok, this is of-topic, but why immigrate from The Netherlands and why for the Love of All that's Holy would you move to the coldest place on earth? I live in Norway and just don't understand this. And sorry, I am aware this is not django related. Thomas On Fri, Sep 30, 2011 at 2:55

Re: View decorator for common navigation elements?

2011-10-03 Thread Thomas Orozco
Maybe you can use template inheritance and have the base template access the data through, alternatively, template filters or instance methods? To make those work, you can take advantage of the existing template processors (notably the auth one). If you want to not have the topnav on a particular

Re: effective adding records in Django site admin

2011-10-04 Thread Thomas Orozco
Regarding your first question, the admin save_as field does exactly this. Le 4 oct. 2011 07:01, "veva...@yandex.ru" a écrit : -- 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

cache_page: force reload

2011-10-06 Thread Thomas Guettler
be ignored. BTW, if you are a developer and want to force a reload, you can add a query-string: http:///foo/?x If you are afraid of denial of service attacks, an attacker could send you a different query-string in every request! }}} Thomas -- Thomas Guettler, http://www.thomas-guettler.

Re: [] memcached not working with django

2011-10-07 Thread TINO THOMAS
Thank you Henrik for your help. I have already given the following entry in settings.py for python-memcached binding CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', 'LOCATION': '127.0.0.1:11211', } } What should i do next , if i wa

Re: [] memcached not working with django

2011-10-07 Thread TINO THOMAS
Thank you Tom, I have set my settings.py appropriately and now caching is working fine. On Fri, Oct 7, 2011 at 7:43 PM, Tom Evans wrote: > On Fri, Oct 7, 2011 at 3:11 PM, TINO THOMAS wrote: > > Thank you Henrik for your help. > > I have already given the following entry in

Re: Don't understand still

2011-10-15 Thread Thomas Orozco
Just don't assign anything to objects and leave that line out of your code ; use the default manager. Le 15 oct. 2011 17:54, "Piotr Hosowicz" a écrit : > On 15 Paź, 17:40, Piotr Hosowicz wrote: > > Carlos, of course I have data in the DB. Babatunde, the managers is > > the thing that my friend,

Closing all connections to DB.

2011-11-01 Thread Thomas Guettler
sycopg2 2.3.2 -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- 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 unsu

QuerySet: "if obj in queryset" can be very slow

2011-11-02 Thread Thomas Guettler
set.filter(id=obj.id): # Fast: Check is done inside DB. print 'in' What is the best way to do "if obj in queryset"? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- You received this message because you are subscr

Re: QuerySet: "if obj in queryset" can be very slow

2011-11-02 Thread Thomas Guettler
lazy. I have no big problem with this, since I found a solution. Is there a reason why "if obj in queryset" is executed in python code, and not in the DB? Thomas Am 02.11.2011 12:42, schrieb Thomas Guettler: > Hi, > > I just discovered, that "if obj in queryset" ca

Re: QuerySet: "if obj in queryset" can be very slow

2011-11-02 Thread Thomas Guettler
queryset.filter(pk=obj.pk).exists(): Related discussion: http://groups.google.com/group/django-users/browse_thread/thread/5a8196ff1086f4ae/530548a127a6e3ca Can someone please provide a patch for the documentation. I am not a native speaker, and won't find the right words. }}} -- T

Caching at model class level

2011-11-03 Thread Thomas Guettler
db) class TicketType(models.Model): objects=ThreadLocalManager() If there would be many TicketTypes, the interpreter would use more and more memory, but there are few. Feedback welcome, Thomas Güttler -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + d

Re: Caching at model class level

2011-11-03 Thread Thomas Guettler
which can get pickled. It does not provide caching at object level, if new query sets get used (like related object look-up). Try it yourself. This middleware shows how many times the same SQL query was executed: http://djangosnippets.org/snippets/344/ Thomas > On Thursday, November 3

Re: Caching at model class level

2011-11-04 Thread Thomas Guettler
Am 03.11.2011 18:42, schrieb Tom Evans: > On Thu, Nov 3, 2011 at 2:22 PM, Thomas Guettler wrote: >> Hi, >> >> I try to reduce the number of db-queries in my app. >> >> There is a model which changes almost never. It is like a "type of ticket" >> in

Re: Which Linux distro to use on EC2?

2011-11-14 Thread Thomas Guettler
core, you write your own kernel and libc. I would use ubuntu. thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Slow page load

2011-11-18 Thread Thomas Guettler
ine. Maybe this helps you to narrow down the part which is slow. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: Bulk import of data

2011-12-04 Thread Thomas Weholt
cket.org/weholt/dse2 And yes, I'm the author of DSE ;-) Regards, Thomas On Sun, Dec 4, 2011 at 3:53 AM, Karen Tracey wrote: > On Sat, Dec 3, 2011 at 9:37 PM, Nathan McCorkle wrote: >> >> when you say 'as long as you don't use the ORM for inserts', >

Website Documentation Search broken?

2011-12-14 Thread Thomas Guettler
Hi, is the search on https://docs.djangoproject.com/en/1.3/ broken, or is it just me, getting no results? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- You received this message because you are subscribed to the Google Groups "D

Re: Website Documentation Search broken?

2011-12-14 Thread Thomas Guettler
Ignore it, this morning even a single word search had no results. Now it works. All is fine Thomas On 14.12.2011 10:55, kenneth gonsalves wrote: On Wed, 2011-12-14 at 10:02 +0100, Thomas Guettler wrote: is the search on https://docs.djangoproject.com/en/1.3/ broken, or is it just me

Re: Which IDE should I use for Django?

2011-12-19 Thread Thomas Weholt
> > > -- > 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 group, send email to > django-users+unsubscr...@googleg

Re: Which IDE should I use for Django?

2011-12-19 Thread Thomas Weholt
to Aptana which oozes Java and PyDev is something added on top. As mentioned, I only got a time-limited license for PyCharm and I'll be looking at other options if I cannot get my license renewed next year. I might also just by a license for PyCharm cuz it's really good :-) Thomas On M

Cascading Select Input Boxes (peek into request data)

2011-12-20 Thread Thomas Guettler
ned. Not impossible, but not nice since I need to support form prefixes, too. In forms.py there is _raw_value(): Returns the raw_value for a particular field name. This is just a convenient wrapper around widget.value_from_datadict. How do you handle "peeking into the request-data"?

Re: Cascading Select Input Boxes (peek into request data)

2011-12-20 Thread Thomas Guettler
On 20.12.2011 11:59, Thomas Guettler wrote: Hi, I have three cascading select input fields. I data is different, but for example: state, city and street. They are all ModelChoiceFields. With jquery and view returning json, it is very easy to fill "city" if you select "stat

Re: Introducing: pythonpackages.com

2012-01-03 Thread Thomas Weholt
jects. Sorry for ranting :-| Still, like the looks of your project :-) So keep up the good work! Thomas On Tue, Jan 3, 2012 at 3:06 AM, Alex Clark wrote: > Hi, > > For the past two months I've been developing a service for developers and > consumers of Python packages: > >

Get database server version

2012-01-03 Thread Thomas Guettler
Hi, while testing my application with 1.4 alpha, I see that connection._version no longer exists. How can I get the database server's version? Up to now I only use postgres, but a portable way would be better. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: gu

Re: Get database server version

2012-01-03 Thread Thomas Guettler
On 03.01.2012 11:22, Thomas Guettler wrote: Hi, while testing my application with 1.4 alpha, I see that connection._version no longer exists. How can I get the database server's version? Up to now I only use postgres, but a portable way would be better. Thomas May postgres

Re: Interface implementation in python

2012-01-04 Thread Thomas Weholt
He probably meant zope.interface :-) Regards, Thomas On Wed, Jan 4, 2012 at 1:47 PM, huseyin yilmaz wrote: > Could you direct me to an example (or documentation). I could not find > any source about zone.interface. > > On Jan 4, 2:17 pm, Donald Stufft wrote: >> Why not

Re: Users getting logged out frequently

2012-01-04 Thread Cherian Thomas
Do you have the SESSION_COOKIE_NAME set correctly? Regards, Cherian On Wed, Jan 4, 2012 at 9:21 PM, arun.pbk wrote: > > I have a Django app using Django social with session timeout set as > SESSION_COOKIE_AGE = 60 * 60 *24 * 7 > The session is being store in the db and rows are inserted for n

Dual license in a django world

2012-01-09 Thread Thomas Weholt
time on my django projects if they generated some kind of income. What do you think? How would a dual license be recieved in the django community? Any tip or thought on the subject would be appreciated. -- Mvh/Best regards, Thomas Weholt http://www.weholt.org -- You received this message

Staging (dev,test,prod) in django

2012-01-12 Thread Thomas Guettler
solutions. Looks too big for me. Fabric: could be used to implement "diff files" and "diff database-table". How do you handle staging? - Deploy the source code and static files - diff files between stages - diff database tables. Thomas -- Thomas Guettler, http://www.t

Re: Alternatives to celery

2012-01-16 Thread Cherian Thomas
Second Arun’s suggestion on gearman. Pretty solid too. Regards, Cherian On Mon, Jan 16, 2012 at 3:52 PM, Alec Taylor wrote: > Looking for an alternative to celery? — Have you considered carrot? > > :P > > -- > You received this message because you are subscribed to the Google Groups > "Djan

Re: Alternatives to celery

2012-01-16 Thread Cherian Thomas
Gearman supports sqlite. Gearman is for jobs, not just data. Regards, Cherian On Mon, Jan 16, 2012 at 8:35 PM, bryan hunt wrote: > Gearman only supports a MySql backend for persistent queues - it > doesn't support a real message queue like Rabbitmq. > > > > On Jan 16, 1

High cpu usage for wsgi apache processes

2012-01-23 Thread TINO THOMAS
Hello, I have a Django setup on cpanel server with python 2.7, virtual env and mod_wsgi. I can see that cpu usage is high for these wsgi apache processes. Is there any way to control this behavior ? Regards Tino -- You received this message because you are subscribed to the Google Groups "Dj

Re: need help with postgres installation and set-up for doing tutorials

2012-11-21 Thread Thomas Lockhart
*On 11/21/12 5:58 AM, Luisa Beck wrote:** * *Thank you for your thoughts! I have a few follow-up questions: * * * *The reason that I’m trying to figure out postgres is that I’m helping some folks with a development project and they’re using postgres. I’m trying to do the tutorial with that so t

Re: Model method versus overriding save()

2012-12-08 Thread Thomas Lockhart
On 12/8/12 5:37 AM, Derek wrote: Rather than use a trigger (which is DB-specific and also hard to debug because not part of your code base), suggest you use signals[1]. Hmm. Triggers have advantages over application-level code where they can be used. They are likely more efficient (no data needs

Re: trouble with pre_delete signal method

2012-12-18 Thread Thomas Orozco
that is causing the ValidationError. Indeed, that line 988 is in the code for ModelChoiceField Best, Thomas 2012/12/17 Mike Dewhirst > I'm getting a baffling ValidationError. > > Request URL: > http://127.0.0.1:8000/admin/**assembly/item/4/<http://127.0.0.1:8000/admin/a

Re: 【HELP】AttributeError: 'AdminSite' object has no attribute 'urls'

2012-12-18 Thread Thomas Orozco
What version of django are you using? admin.site.urls was introducd four years ago ( https://github.com/django/django/commit/1f84630c87f8032b0167e6db41acaf50ab710879), but maybe you're running an older version? Best, Thomas 2012/12/15 向浩 > Environment: > > Request Method: GET

Re: 【HELP】AttributeError: 'AdminSite' object has no attribute 'urls'

2012-12-18 Thread Thomas Orozco
Haha indeed, silly me! Well I think that's the error cause then : the urls property apparently didn't exist in Django 1.0! Cheers, Thomas On Dec 18, 2012 3:14 PM, "Ramiro Morales" wrote: > On Tue, Dec 18, 2012 at 10:12 AM, Thomas Orozco wrote: > > What ve

Re: trouble with pre_delete signal method

2012-12-19 Thread Thomas Orozco
I missing something here? Last, would you mind sharing the bpart.a_partcodes code ? Cheers, Thomas 2012/12/19 Mike Dewhirst : > Thomas > > Thanks for replying > > > On 19/12/2012 12:06am, Thomas Orozco wrote: >> >> Hi, >> >> >> Could you provid

Re: trouble with pre_delete signal method

2012-12-19 Thread Thomas Orozco
Hi Mike, Could you try using a debugger as suggested? Otherwise and if that's OK with you / your job, could you send me minimal model code off-list so I can have a look at it? I'm pretty sure we're just missing something obvious! : ) Cheers, Thomas 2012/12/19 Mike Dewhirst

Re: trouble with pre_delete signal method

2012-12-20 Thread Thomas Orozco
It's great that you could find where the issue is coming from! Cheers, Thomas 2012/12/20 Mike Dewhirst > On 19/12/2012 11:58pm, Thomas Orozco wrote: > >> Hi, >> >> If you have no relationship, I'm a bit at a loss. I think the easier >> way would b

Unicode/Non-ASCII characters in the admin throws exception

2013-01-28 Thread Thomas Weholt
74. s = unicode(str(s), encoding, errors) Exception Type: UnicodeEncodeError at /admin/storyquest/story/11/Exception Value: 'ascii' codec can't encode character u'\xd8' in position 0: ordinal not in range(128) I'm running Python 2.7.3, django 1.4.

Re: Unicode/Non-ASCII characters in the admin throws exception

2013-01-29 Thread Thomas Weholt
tch to the maintainers. First up; Django debug toolbar :-) Thomas On Monday, January 28, 2013 10:07:22 PM UTC+1, Thomas Weholt wrote: > > This is a recurring problem for django users obviously by the amount of > posts returned by google and I've had this problem in the past as well, but

Re: plz help me i have checked many time but i could not find error place.....

2013-02-06 Thread Thomas Weholt
Have you executed python manage.py syncdb? Thomas On Wed, Feb 6, 2013 at 2:22 PM, Avnesh Shakya wrote: > > I have checked many time, even i have deleted my project n i have created > new project again and create new model but error is occurred again n again.. > i m beginner so

Django 1.5 & Python 3 - porting packages to Python3

2013-02-15 Thread Thomas Weholt
), django-debug-toolbar, django-celery etc. Are there any focus in the community on getting packages ready for python3? -- Mvh/Best regards, Thomas Weholt http://www.weholt.org -- You received this message because you are subscribed to the Google Groups "Django users" group. To u

django-quickview v0.1 released - proof-of-concept/comments wanted

2013-02-18 Thread Thomas Weholt
you can browse the source at https://bitbucket.org/weholt/django-quickview. The testsite-folder at bitbucket contains a working example. -- Mvh/Best regards, Thomas Weholt http://www.weholt.org -- You received this message because you are subscribed to the Google Groups "Django users&qu

Re: error in templates...

2013-02-19 Thread Thomas Weholt
It means you haven't added any url matching / in your urlconfig, but it's hard to give a good answer without a bit more information. Have you completed the django tutorial which explains how these things work? Thomas On Tue, Feb 19, 2013 at 11:04 AM, Avnesh Shakya wrote: > Hello,

Re: ANNOUNCE: Django 1.5 released

2013-02-26 Thread Thomas Weholt
. Now if only the django-debug-toolbar and PIL could be ported to Python 3 as well all my problems would be solved ;-) Great work! Thomas On Tue, Feb 26, 2013 at 10:56 PM, william ratcliff wrote: > Kudos! I'm really excited about this version and the new User model!!! > > > O

Announcement: django-quickview 0.3 - putting the nitro in rapid web development

2013-02-27 Thread Thomas Weholt
;-) -- Mvh/Best regards, Thomas Weholt http://www.weholt.org -- 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 django-users+unsubscr...@googlegroups.com. To po

Re: Announcement: django-quickview 0.3 - putting the nitro in rapid web development

2013-02-28 Thread Thomas Weholt
Packaging python is hard!! Fixed the problem now. pip install django-quickview works. Sorry. Thomas On Thu, Feb 28, 2013 at 5:03 AM, Bino Oetomo wrote: > > > On Feb 28, 2:39 am, Thomas Weholt wrote: >> >> Documentation and tutorial >> athttps://bitbucket.org/

Re: Announcement: django-quickview 0.3 - putting the nitro in rapid web development

2013-02-28 Thread Thomas Weholt
On Thu, Feb 28, 2013 at 4:10 PM, Tom Evans wrote: > On Wed, Feb 27, 2013 at 7:39 PM, Thomas Weholt > wrote: >> pypi : https://pypi.python.org/pypi/django-quickview/ >> Source at https://bitbucket.org/weholt/django-quickview >> >> Documentation and tutorial at &

Re: RSS combinator

2013-03-07 Thread Thomas Lockhart
On 3/7/13 7:24 PM, Lachlan Musicman wrote: Hola, > > Does anyone know of a django app that would take a number of rss > feeds and turn it into a single blog feed/stream? I'm using feedjack and I think it has features to amalgamate the feeds; I use it to subscribe to feeds then choose sets of f

Profiling django apps using Python 3? No hotspot module.

2013-03-14 Thread Thomas Weholt
h Python 3? If not I'll try to port one of the ones I've found but why re-invent the wheel? -- Mvh/Best regards, Thomas Weholt http://www.weholt.org -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this g

Re: Profiling django apps using Python 3? No hotspot module.

2013-03-14 Thread Thomas Weholt
Thanks a bunch :-) Got it working in python 3 with minor tweaking. Thomas On Thu, Mar 14, 2013 at 3:09 PM, Shawn Milochik wrote: > I use this and it's great. I haven't tried it with Python 3, but it's > all standard library stuff. > > I tweaked mine a bit so it du

Re: django notification like facebook

2013-03-18 Thread Thomas Weholt
On Mon, Mar 18, 2013 at 2:56 PM, Randa Hisham wrote: > what is the best django app for executinng realtime notification WebSockets or ajax polling? Don't know of any app for it though. Thomas > > -- > Randa Hesham > Software Developer > > Twitter:@ro0or

Suddenly manage.py syncdb fails with 'no such table django_session'

2013-04-04 Thread Thomas Weholt
ath.abspath(__file__)) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(PROJECT_PATH, 'database.db'), 'USER': '', 'PASSWORD': '', '

Re: djano user registration form and login(full example)

2013-04-07 Thread Thomas Rega
Am 06.04.2013 um 16:30 schrieb Shawn Milochik: > I've seen some situations where it looked like signals are received multiple > times. > > However, you can easily fix that by checking for the existence of the user in > your function, or a try/except that handles the integrity error. or by usa

Re: Stop Django admin

2013-04-07 Thread Thomas Rega
Hi, that is because django tries to resolve this url, which is not possible and also probably not wanted. IMHO you have to use an extra subdomain. - e.g. phpmyadmin.ec2-xx-xxx-xx-x.cumpute-1.amazon… - to deliver such kind of content. It has to be handled beyond the wsgi. BTW: http://stackove

Re: Suddenly manage.py syncdb fails with 'no such table django_session'

2013-04-09 Thread Thomas Weholt
I've later discovered that, in my case, one of my other packages, which monkey patches my models, most likely is the cause of the problem. Thomas On Tue, Apr 9, 2013 at 12:41 PM, Serdar Dalgic wrote: > On Thu, Apr 4, 2013 at 10:24 PM, Thomas Weholt > wrote: > > I haven'

Re: Status of Django with Python 3.x

2013-04-11 Thread Thomas Weholt
Visit this group at http://groups.google.com/group/django-users?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Mvh/Best regards, Thomas Weholt http://www.weholt.org -- You received this message because you are subscribed to the Google Groups &qu

Re: What to Django people have to say about Javascript frameworks to complement Django's philosophy on the front end

2013-04-17 Thread Thomas Weholt
ngo-users+unsubscr...@googlegroups.com. >> To post to this group, send email to django-users@googlegroups.com. >> Visit this group at http://groups.google.com/group/django-users?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >>

Re: IDE to practice django template language

2013-04-19 Thread Thomas Weholt
en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails

Re: IDE to practice django template language

2013-04-19 Thread Thomas Weholt
I have no experience in WingIDE, but PyCharm supports django development with intregrated starting of server, running of unittests, running of commands like syncdb etc. That was a terribly sales-pitch, but search google or youtube and you'll find videos demonstrating its features. Thomas O

Re-usable app for REST API creation with Python 3 support?

2013-04-22 Thread Thomas Weholt
wrong? -- Mvh/Best regards, Thomas Weholt http://www.weholt.org -- 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 django-users+unsubscr...@googlegroups.

Deploying CSS/JS with pip

2013-05-21 Thread Thomas Güttler
fanstatic together with django? My goal is to easy the automated deployment. How do you handle the dependency on external resources like jquery libraries? Do you store a tgz file inside your source code repository? Regards, Thomas Güttler [1] http://www.fanstatic.org/en/latest/ -- You rec

Re: How to stop internal django server

2013-05-24 Thread Thomas Brandenburger
thanks Am Sonntag, 28. September 2008 14:44:22 UTC-7 schrieb Hingarajiya,Ravi: > > Jeff : > > Thanks for reply. > > Ravi Hingarajiya > > On Sun, Sep 28, 2008 at 2:41 PM, Jeff Anderson > > > wrote: > >> Hingarajiya,Ravi wrote: >> > Hi Alessandro, >> > >> >Thanks for your reply.I know kill c

Re: Please help me in Django

2013-06-10 Thread Thomas Weholt
stall Then read the official django tutorial/docs. They are all exceptionally good and should get you going. Thomas On Mon, Jun 10, 2013 at 12:57 PM, Abhimanyu Choithramani < life.abhi.l...@gmail.com> wrote: > I downloaded Python 2.7.5 and it started working. > And I downloaded Djan

Re: How does it all work

2013-06-10 Thread Thomas Weholt
ython ) There's a long way and lots of codelines from a basic "Hello world" webapp to a framework like django, but you'll learn alot by starting with the standard webrelated stuff in standard python. Thomas On Mon, Jun 10, 2013 at 4:10 PM, Nafiul Islam wrote: > Hi! >

Re: background image for table not apply in printout page and email copy - Django

2013-06-13 Thread Thomas Weholt
available for users outside your network for it to be displayed correctly in an email. PS! - This problem is not django specific and should be posted to a group more aimed at webdevelopment in genereal. Thomas On Thu, Jun 13, 2013 at 11:19 AM, wrote: > html: > > > >

Re: How to make set background image for printout layout

2013-06-13 Thread Thomas Weholt
http://bytes.com/topic/html-css/answers/465772-how-force-print-css-background-image PS! This question is not django-specific. You'll probably get faster and better results trying in a more appropriate group or forum. Thomas On Thu, Jun 13, 2013 at 2:12 PM, Sivaram R wrote: > Hi,i am d

Re: Getting Started with Mac OS X

2013-07-14 Thread Thomas Lockhart
On 7/14/13 1:26 PM, Mando wrote: Hi, This is the way I have it set up my osx $ sudo pip install virtualenv $ virtualenv --distribute pytho_projects $ source python_projects/bin/activate $ (python projects) pip install django $ django-admin.py startproject myblog and that should get you past t

Re: Django installation on vanilla Mac OSX 10.8.2 mountain lion

2013-08-02 Thread Thomas Lockhart
On 8/2/13 7:41 AM, Sithembewena Lloyd Dube wrote: Hi everyone, I just began using a new Mac at work (running OSX 10.8.2 Mountain Lion) and it seems such a mission to install Django. Python 2.7.2. is already installed. Following the official Django installation instructions, I get no further t

Re: django template loop collections.defaultdict(lambda: collections.defaultdict(list))

2013-08-24 Thread Thomas Scrace
On 23 Aug 2013, at 16:58, Daviddd wrote: > In my template I tried: > > {% for key, groups in queryset.iteritems %} > groups = {{ groups }} > {% for group_key, cols in groups.iteritems %} > cols = {{ group_key }} > {% for objs in cols %} > {# rest of the code #} >

Re: Django IndexError: list index out of range

2013-08-24 Thread Thomas Scrace
On 24 Aug 2013, at 16:02, Oleg Gorjajnov wrote: > And this is not my case. > > So what's wrong with that? It must work well without meta classes. > Do you get any problems when you do manage.py runserver or syncdb? I think your problem stems from trying to build within Sublime Text. -- Yo

Re: MySQL manage.py dbshell throwing error unknown variable 'character-set-server=utf8'

2013-08-24 Thread Thomas Scrace
On Saturday, 24 August 2013, Brian Lee wrote: > So, my website, involving lots of database calls, works perfectly fine, > even after a reboot. > > However, attempting to connect directly via dbshell results in this error: > $ ./manage.py dbshell > mysql: unknown variable 'character-set-server=utf

Re: MySQL manage.py dbshell throwing error unknown variable 'character-set-server=utf8'

2013-08-24 Thread Thomas Scrace
On Sunday, 25 August 2013, Brian Lee wrote: > [client] > 20 port= 3306 > 21 socket = /var/run/mysqld/mysqld.sock > 22 > 23 # Here is entries for some specific programs > 24 # The following values assume you have at least 32M ram > 25 > 26 # This was formally known as [safe_mysq

Re: DecimalField

2013-08-25 Thread Thomas Scrace
You're creating an entirely new DecimalField, rather than altering the error messages of your existing field. I think what you want is: class YourForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(YourForm, self).__init__(*args, **kwargs) self.fields["amount"

Re: django template loop collections.defaultdict(lambda: collections.defaultdict(list))

2013-08-26 Thread Thomas Scrace
On Monday, 26 August 2013, Daviddd wrote: > Sincerely, I don't know how I can create the dict without using > defaultdict. > > D > You can create it using a defaultdict if you want to, but once it is created, and before you pass it to the template, loop through all the values of your outer dict a

Re: Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Thomas Orozco
Change you regex to: r'^[a-zA-Z0-9]{1,4}' On Sat, Aug 31, 2013 at 5:41 PM, Gerd Koetje wrote: > Hi all, > > How do i valididate for this? > > - numbers and text only , no spaces > - max 4 number > > > > > def clean_profielnaam(self): > data = self.cleaned_data['profielnaam'] >

Re: Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Thomas Orozco
Oh, yes, we need to search for the end of the string: r'^[a-zA-Z0-9]{1,4}$' On Sat, Aug 31, 2013 at 6:03 PM, Gerd Koetje wrote: > that still allows space,weird chars and more then 4 numbers > > input: > dfdfdf565665&^^^ > got saved > > > > def clean_

Re: Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Thomas Orozco
Oh, I thought you needed only 4 total chars. Using a regex probably is a bit overkill here: >>> import string >>> accepted = string.letters + string.digits >>> max_numbers = 4 >>> >>> def test(word): ... numbers = 0 ... for c in word: ... if c.isdigit(): ... numbers +

Re: Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Thomas Orozco
Because the indentation is not correct, and doesn't correspond to what I sent you. `return True` should be 4 chars left of where it currently is. On Sat, Aug 31, 2013 at 7:23 PM, Gerd Koetje wrote: > it somehow keeps returning True on everything > > accepted = string.letters + string.digits > m

Re: Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Thomas Orozco
test(data) returns True if the string is acceptable, and False if it's not. But False is an object, it's not the the string "False" - I'd strongly recommend you start with a Python tutorial before moving on to your Django project. Cheers; On Sat, Aug 31, 2013 at 7:27 PM, Gerd Koetje wrote: > t

Re: Passing initial values to a form

2013-09-01 Thread Thomas Orozco
The URL parameter (iid) is accessible in your view in self.kwargs["iid"]. You can pass it to the form by overriding your view's `get_initial` method ( https://github.com/django/django/blob/1.6b2/django/views/generic/edit.py#L22 ) `get_initial` should return a dict, and you should use: { 'na

Re: URL Mapping Confusion

2013-09-09 Thread Thomas Lockhart
On 9/9/13 3:30 PM, Chris Kavanagh wrote: I haven't used this group in a long time, so I hope I do everything correctly. If I don't, I apologize in advance. I thought I understand the way django uses URL's in the urlconf to match URL's, but I was wrong. Here's my question: Here's my urlconf.

Re: URL Mapping Confusion

2013-09-09 Thread Thomas Lockhart
Tom, thanks so much for the reply. . .Yes, that was a typo, it should've been "/articles" not "/article". I know this is going to be a stupid question, but why do my "urlconf" paths need to have "/articles" in it as you said? There are three steps in the interpretation of the patter

Re: URL Mapping Confusion

2013-09-09 Thread Thomas Lockhart
the three steps in matching a nested URL. hth - Tom I hope I made my question a little clearer, lol. I'm not sure how to ask what I want to know. But again, THANKS for the help Tom! On Mon, Sep 9, 2013 at 7:48 PM, Thomas Lockhart mailto:tlockha

Re: Workflow/tools assistance

2013-09-12 Thread Thomas Lockhart
On 9/12/13 6:44 AM, Sayth Renshaw wrote: On Thursday, September 12, 2013, Germán Larraín wrote: Some comments: * why use sqlalchemy if Django has its own ORM? * you mentioned parsing SQL entries; watch out! * if you are starting a new project, I seriously recommend you to

Re: error

2013-09-13 Thread Thomas Orozco
If the request is a GET (and not a POST), you never return and HTTPResponse (or anything, for that matter, so you're returning None) On Fri, Sep 13, 2013 at 4:39 PM, Harjot Mann wrote: > I am making an app to add time schedule and while making view. I ma > getting this error > > The view time_sc

Re: Where to put code that adds additional data to the model object?

2013-09-13 Thread Thomas Orozco
You can define it in the Model. Models are still "regular" Python objects that you can add methods to. Be wary of performance though, if you don't cache the results or something. On Fri, Sep 13, 2013 at 4:33 PM, Ladislav P wrote: > Hi, > > I have started working with django just couple of days

Overriding Settings before running any tests that loads fixtures.

2013-09-21 Thread Alex Thomas
My basic problem is that I am trying to run a test that loads fixtures but I want to modify some settings before the fixtures are loaded. I tried adding override_settings decorator on the class but it does not see to take effect before the fixtures are loaded. I also posted the question here

Re: Overriding Settings before running any tests that loads fixtures.

2013-09-22 Thread Alex Thomas
Instead of buying the book I finally found a solution. I posted to the original stackoverflow question: http://stackoverflow.com/questions/18927935/what-is-the-order-of-execution-in-django-tests On Saturday, September 21, 2013 7:47:58 PM UTC-4, Alex Thomas wrote: > > My basic problem i

Re: Using unique_together with foreign key fields which may be None

2013-10-01 Thread Thomas Lockhart
On 10/1/13 6:36 AM, Derek wrote: We encountered the same problem for a complex model ... we ended up defining "acceptable" default values that are used instead of None/NULL, but essentially mean the same thing to the user. (We are using MySQL which adopts the same approach as Postgresql - I be

Re: Possible documentation/implementation bug for unique_together

2013-10-11 Thread Thomas Orozco
Those two tuples are stricly equivalent from Python's point of view, so the problem must be somewhere else, Did you change anything else? What's the error message like? Cheers, On Fri, Oct 11, 2013 at 11:46 PM, puff wrote: > I'm relatively new to Django and used unique_together in 1.5 per the

Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread Thomas Lockhart
On 10/16/13 8:29 AM, Jimmy Pants wrote: ...every time I open a terminal, that is. As I understand it, .profile is the file to edit in Linux Mint, and it does exist, with some basic code in it, in my home dir. So, per this tutorial

Re: Ubuntu, Postgres, and psycopg2.

2013-10-17 Thread Thomas Orozco
You need the Postgres client C headers to build psycopg2. Before running pip install psycopg2, run: sudo apt-get install libpq-dev On Thu, Oct 17, 2013 at 10:51 AM, Nigel Legg wrote: > I am not sure whether this is really a postgres issue or a python / Django > issue - please let me know if

Re: Ubuntu, Postgres, and psycopg2.

2013-10-17 Thread Thomas Orozco
You're missing: sudo apt-get install python-dev On Thu, Oct 17, 2013 at 11:31 AM, Nigel Legg wrote: > Thanks Thomas, that worked, so some progress, but now when I do sudo pip > psycopg2, I get an error: Python.h not found - > In file included from psycopg/psycopgmodule.c:27:

Re: Can not connect to MySQL

2013-10-17 Thread Thomas Orozco
Most likely it's the MySQLdb package ( https://pypi.python.org/pypi/MySQL-python) that's not installed. Installing it *will* require installing libmysql-client first, though. On Thu, Oct 17, 2013 at 10:05 PM, François Schiettecatte < fschietteca...@gmail.com> wrote: > Could be a number of thing

<    3   4   5   6   7   8   9   10   11   12   >