How do I manage a Non-default Django PostgreSQL database

2015-04-08 Thread Stephen M
Also posted to stackoverflow: How do I manage a Non-default Django database [image: image] How do I

login_required decorator in Django: open modal instead of redirecting to another page

2015-04-08 Thread Roh Codeur
Hi I have a django app which has certain sections which are reserved for registered users. I have the views annotated with login_required decorator which redirects the user to a login page. However, I would like to keep the user on the same page and open up a modal dialog prompting user to s

Re: Modifying admin add behaviour

2015-04-08 Thread Larry Martell
On Tue, Apr 7, 2015 at 7:04 PM, Larry Martell wrote: > On Tue, Apr 7, 2015 at 5:40 PM, Larry Martell wrote: >> I have a model and I want to have this behaviour in admin: >> >> 1. Only the add button is shown. >> 2. When the user clicks the add button, it brings up the standard >> page, but with j

Re: Model with two e-mail fields uniques

2015-04-08 Thread Bruno A.
Right, I missed that detail :/ Agree the ModelForm seem a better place to add this validation. On Wednesday, 8 April 2015 22:22:02 UTC+1, victor menezes wrote: > > I liked the idea at first but after couple tests realized that the it will > alway raise the error on save(). > > The problem is tha

Re: Model with two e-mail fields uniques

2015-04-08 Thread victor menezes
I liked the idea at first but after couple tests realized that the it will alway raise the error on save(). The problem is that I can't add any Email without Person, this looks great but, I also can't add a Person without an Email and so it will never allow me to add anything. Maybe I should k

Re: Model with two e-mail fields uniques

2015-04-08 Thread Javier Guerra Giraldez
On Wed, Apr 8, 2015 at 12:18 PM, Luis Zárate wrote: > > if you know that only have two emails for user and you check his email a lot > then the cost of join in time and machine resources increase innecessarily "normalize until it hurts, denormalize until it runs" here the OP is way, way, behin

Using multiple form in Class Base View (CBV)

2015-04-08 Thread Rootz
Can anyway give me advice as to how I would implement a CBV like formview to incorporate multiple forms in the class base view? I have (2) form class I would like for my FormView to use? But I am not sure how to do that with the FormView or any class base view. Thanks -- You received this mes

annotate() questions

2015-04-08 Thread Carsten Fuchs
Dear Django fellows, at https://docs.djangoproject.com/en/1.8/topics/db/aggregation/#joins-and-aggregates the first example is: >>> from django.db.models import Max, Min >>> Store.objects.annotate(min_price=Min('books__price'), max_price=Max('books__price')) which will annotate each Store ob

Re: Model with two e-mail fields uniques

2015-04-08 Thread Luis Zárate
I don't know if work with many to many is the best approach, because if you know that only have two emails for user and you check his email a lot then the cost of join in time and machine resources increase innecessarily So knowledge of you requirements determine your db scheme. Using the first s

Re: uploadhandler.py comparing str with int

2015-04-08 Thread Tim Graham
Does your project set that setting to a string by mistake? In the default settings: >>> from django.conf import settings >>> settings.FILE_UPLOAD_MAX_MEMORY_SIZE 2621440 >>> type(settings.FILE_UPLOAD_MAX_MEMORY_SIZE) On Tuesday, April 7, 2015 at 2:11:08 PM UTC-4, Jason Wilson wrote: > > Line 16

Re: TIMEZONE

2015-04-08 Thread Luis Zárate
Other thing that I forgot in the last mail is how use function now() Wrong solution from datetime import datetime datetime.now() Good solution from django.utils import timezone timezone.now() 2015-04-08 10:16 GMT-06:00 Luis Zárate : > Do you have installed pytz ? Django use it when USE_TZ

Re: TIMEZONE

2015-04-08 Thread Luis Zárate
Do you have installed pytz ? Django use it when USE_TZ is True. 2015-04-08 6:54 GMT-06:00 Olalla Galiñanes Feijoo < olalla.galina...@gmail.com>: > Time zone support is disabled by default. To enable it, set USE_TZ = True >

MEDIA_URL doesnt work in windows but works on linux

2015-04-08 Thread dk
in my settings MEDIA_ROOT = os.path.join(BASE_DIR, 'media') MEDIA_URL = "/media/" my view to accept files. def request_page(request): #todo since sqlite my get stuck between 2 submittion at the same time, # submit, if it cant try again and then message that ask the user to try in 5 mins. tr

Re: django 1.8 upgrade custom user model syncdb

2015-04-08 Thread Markus Holtermann
Hey Jochen, glad it works now. In that case you want to look at https://docs.djangoproject.com/en/1.8/ref/settings/#migration-modules and place the migrations somewhere in your project. Otherwise the migrations end up in your virtualenv and are not available when you deploy the application. Best

Re: django 1.8 upgrade custom user model syncdb

2015-04-08 Thread Jochen Wersdoerfer
On Wednesday, April 8, 2015 at 4:56:43 PM UTC+2, Jochen Wersdoerfer wrote: > > > There’s an initial migration for my custom user model in accounts.models, > so the accounts_pixolususer table should have been created. The syncdb > command breaks while adding a constraint to an app without migrations

Re: Model with two e-mail fields uniques

2015-04-08 Thread Bruno A.
+1 for Javier's answer, use a simple Foreign key on the e-mail field, not a ManyToMany on the Person (M2M allows an email to belong to multiple users). The Foreign key ensures an e-mail belongs to only 1 user, and that 2 users cannot have the same e-mail, but lets a user have multiple. To force

django 1.8 upgrade custom user model syncdb

2015-04-08 Thread Jochen Wersdoerfer
Hi *, I’m trying to upgrade to django 1.8, but running into some app-dependency issues: http://pastebin.com/uvKtBtNa There’s an initial migration for my custom user model in accounts.models, so the accounts_pixolususer table should have been created. The syncdb command breaks while adding a cons

Re: TIMEZONE

2015-04-08 Thread Olalla Galiñanes Feijoo
Time zone support is disabled by default. To enable it, set USE_TZ = True in your settings file. https://docs.djangoproject.com/en/1.8/topics/i18n/timezones/ El miércoles, 8 de abril de 2015, 14:18:25 (UTC+2), akash...@ra

Re: TIMEZONE

2015-04-08 Thread Jirka Vejrazka
Hello there, you probably need to take a look at the USE_TZ setting too. If it's True, then Django will store all times in the UTC timezone and only use the one you configured in views and templates (and a few other places). In most cases, that's what you want anyway as it's the most reliable

TIMEZONE

2015-04-08 Thread akash . patni
Hi to all , Previously my settings.py file was having time zone as TIME_ZONE = 'America/Chicago' now i have changed to TIME_ZONE = 'Europe/London' that not getting reflected means date and time are getting stored in database as of previous timezone... Please suggest. -- You received this

Re: show code in template

2015-04-08 Thread Hanz
Thank you for idea Luisza14, verbatim tag is that thing what i needed >>> {% verbatim html %} >>> {{object.name}} {% endverbatim html %} Hanz Dne úterý 7. dubna 2015 20:26:42 UTC+2 luisza14 napsal(a): > > I don't understand what

Re: Issues downloading documentation offline

2015-04-08 Thread Nkansah Rexford
Thanks, Graham -- 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 post to this group, send email to django-users@googl

Re: How can I work with pyserial and django form?

2015-04-08 Thread José Jesús Palacios
Ok, thanks guys. I'll answer myself. At the moment I am more focused on the problem. I think it's an off-topic here. In short, the problem should be solved at the client side, not on the server side. Node.js can handle this with node-serialport and Garrows has a development one step further: ht

Problem with error admin.E202 on OneToOneRelation

2015-04-08 Thread Richard la Croix
Hello, I have problems with a OneToOneRelation in this simple model. Without Inline in the admin.py it basically works, but when I add an Inline for the Address to the Resort, I get error messages like: : (admin.E202) 'testApp.Address' has no ForeignKey to 'testApp.Resort'. I think that I foll

Re: Django Docs not found

2015-04-08 Thread Eugene Yeo
Ya, it's up again. Thanks :) On Wednesday, April 8, 2015 at 12:13:43 AM UTC+8, larry@gmail.com wrote: > > On Tue, Apr 7, 2015 at 11:44 AM, Eugene Yeo > wrote: > > Django Docs seems down except its latest development. > > > > https://docs.djangoproject.com/en/1.8/ (Not working) > > Works f