Re: Strange behaviour of django of form submit by POST

2015-04-07 Thread Luigi Cirillo
sorry, I posted the code of thefile venv/local/lib/python2.7/site-packages/django/template/response.py at line 83 with the # but the real code that I execute is: # ... @property def rendered_content(self): """Returns the freshly rendered

Re: Upload above apache web root?

2015-04-07 Thread Daniel Roseman
On Monday, 6 April 2015 22:38:36 UTC+1, Stephanie Socias wrote: > > I've implemented this same solution (using custom file storage and the > "upload_to" parameter) but now cannot get the uploaded files to display > from my template. I would normally use {{ STATIC_URL }} but, since I've now > spe

Re: Flexible For loop

2015-04-07 Thread Nkansah Rexford
Thanks for pointing out. That's the solution then! -- 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 gro

Re: KeyError: 'default'

2015-04-07 Thread Flavia Missi
Hi, >From Django 1.6 to Django 1.7 *migration *handling was added to Django, so I suppose you cannot run your project with 1.7 without performing the required changes. If you're using south, take a look here: https://docs.djangoproject.com/en/1.7/topics/migrations/#upgrading-from-south Also, I se

Re: Upload above apache web root?

2015-04-07 Thread Stephanie Socias
Thank you very much for responding, Daniel. I'm sorry I don't quite follow- I've never done this before. I should use the URL {{ datamine.image.url }} in the template? On Tue, Apr 7, 2015 at 5:36 AM, Daniel Roseman wrote: > On Monday, 6 April 2015 22:38:36 UTC+1, Stephanie Socias wrote: >> >> I

Django 1.8, django-formtools and 3rd party app setup.py

2015-04-07 Thread Troy Grosfield
The full discussion on this topic can be found at: - https://github.com/Bouke/django-two-factor-auth/pull/90 In summary, with the release of django 1.8 all the formtools logic was moved to a separate repo. The question is, how does a 3rd party app that requires formtools setup the instal

Custom field definition for an iterable Python object

2015-04-07 Thread David Pick
I'm trying to write a custom field definition for a Python object that happens to be iterable. Most of the time it works, but sometimes I get an error generated in 'django/db/models/sql/where.py' in '_prepare_data' where the code tries to generate all the values in the iterable object because

Re: Multiple Django Forms

2015-04-07 Thread Stephanie Socias
Thank you all for you suggestions/help. I was finally able to get this working by using django-dynamic-formset Bill Blanchard helped me figure it out! I will post a more detailed solution in my other post here on this forum ("Help with Dynamic

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

2015-04-07 Thread Bill Freeman
It sounds as though you have a set of sensors (scales, license readers, barcode readers) which provide their readings over asynchronous serial (that's what pyserial can connect with). You have some computer or set of computers that collectively provide a sufficient number of serial ports to interf

Re: Help with Dynamically Adding Forms to Formset!!

2015-04-07 Thread Stephanie Socias
Thank you SO much to Bill Blanchard for helping me figure this out! The main issue was that {{ formset.management_form }} was in the div being used by the javascrip to add/delete forms. So, it was causing the error. We moved it out of the div, just before the closing tag and it worked great!

Re: Upload above apache web root?

2015-04-07 Thread Stephanie Socias
Do I need to update/add something to my urls.py? On Tuesday, April 7, 2015 at 9:51:56 AM UTC-4, Stephanie Socias wrote: > > Thank you very much for responding, Daniel. > > I'm sorry I don't quite follow- I've never done this before. I should use > the URL {{ datamine.image.url }} in the template?

Django Docs not found

2015-04-07 Thread Eugene Yeo
Django Docs seems down except its latest development. https://docs.djangoproject.com/en/1.8/ (Not working) https://docs.djangoproject.com/en/dev/ (Working) It would be good to let the django docs team to restore the docs for all version. -- You received this message because you are subscribed

Re: Django Docs not found

2015-04-07 Thread Larry Martell
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 for me. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe fr

Problem with url template tag and namespaces

2015-04-07 Thread donarb
I'm having a problem with a generated url using the url template tag, currently using Django 1.6.5. The appname is 'dashboard', here is the main urls.py: urlpatterns = patterns("", (r'^dashboard/', include('dashboard.urls', namespace='dashboard')), ) Here is the dashboard urls.py: # dash

Re: Upload above apache web root?

2015-04-07 Thread Luis Zárate
Hi, Django provide for development MEDIA_URL and MEDIA_ROOT for uploaded file, for production used static deploy strategy, see the documentation about static files. Model file field has an url attribute that return a media url, you use in template like {{obj.file.url}} El martes, 7 de abril de

Re: Upload above apache web root?

2015-04-07 Thread Stephanie Socias
Hi Luis, Yes, I used {{ datamine.image.url }} in my template but it doesn't work. I'm not sure how to format my urls.py since I haven't changed the MEDIA_URL and MEDIA_ROOT. I want to upload these images to a location not in my MEDIA_ROOT...? This is my urls.py: urlpatterns = patterns('', # E

Re: Upload above apache web root?

2015-04-07 Thread Luis Zárate
You are not set base_url in FileSystemStorage so you are using MEDIA_URL by default. The imagefield url property is called like this def _get_url(self): self._require_file() # check if It is an object return self.storage.url(self.name) url = property(_get_url) And self.st

uploadhandler.py comparing str with int

2015-04-07 Thread Jason Wilson
Line 167 in django/core/files/uploadhandler.py printing the type of the object settings.FILE_UPLOAD_MAX_MEMORY_SIZE shows this object is read as a string at this point in the code. Therefore, the comparison always returns False and self.activated is True ' ---

show code in template

2015-04-07 Thread Hanz
Hi everyone, i want to show some piece of code on my website. What is the best way to do it? (embed into template) >>> {{ object.name }} Regards, Hanz -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop rec

Re: show code in template

2015-04-07 Thread Luis Zárate
I don't understand what you want to do but I guest it's like verbatim https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#verbatim 2015-04-07 12:18 GMT-06:00 Hanz : > Hi everyone, > i want to show some piece of code on my website. What is the best way to > do it? (embed into template)

Model with two e-mail fields uniques

2015-04-07 Thread victor menezes
Hi there, What would be the best way to make a model with two e-mail fields uniques? I was thinking about writing some validation in the save() method but would like to know whether Django has some built-in way to deal with it. class Person(models.Model): first_name = models.CharField(max_len

Re: Model with two e-mail fields uniques

2015-04-07 Thread Javier Guerra Giraldez
On Tue, Apr 7, 2015 at 2:20 PM, victor menezes wrote: > What would be the best way to make a model with two e-mail fields uniques? I > was thinking about writing some validation in the save() method but would > like to know whether Django has some built-in way to deal with it. it's a very bad id

Re: Upload above apache web root?

2015-04-07 Thread Stephanie Socias
Thank you all for your input. It turns out my settings file was improperly configured. I needed to change MEDIA_ROOT and MEDIA_URL On Tue, Apr 7, 2015 at 12:30 PM, Luis Zárate wrote: > Hi, > > Django provide for development MEDIA_URL and MEDIA_ROOT for uploaded file, > for production used static

Modifying admin add behaviour

2015-04-07 Thread Larry Martell
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 just 1 custom button shown. 3. When the user clicks that custom button, I execute an ajax call and display the results below

Issues downloading documentation offline

2015-04-07 Thread Nkansah Rexford
Downloading offline documentation doesn't work from the djangoproject.com This link: https://docs.djangoproject.com/m/docs/django-docs-1.8-en.zip results in a mere 22bytes size .zip file with no content in the package. Same for the PDF Even this one: http://media.readthedocs.org/pdf/django/1.8.

Re: Model with two e-mail fields uniques

2015-04-07 Thread victor menezes
Thanks for the help, I end up doing it was easy to implement the email as TabularInline inside the Person form in the Admin but how would you make mandatory to have at least one e-mail? Should I validate inside the save() method of Person class? On Tuesday, April 7, 2015 at 3:55:26 PM UTC-4, Ja

Re: Problem with url template tag and namespaces

2015-04-07 Thread donarb
On Tuesday, April 7, 2015 at 9:19:17 AM UTC-7, donarb wrote: > > I'm having a problem with a generated url using the url template tag, > currently using Django 1.6.5. > > The appname is 'dashboard', here is the main urls.py: > > urlpatterns = patterns("", > (r'^dashboard/', include('dashboard.

Re: Modifying admin add behaviour

2015-04-07 Thread Larry Martell
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 just 1 custom button shown. > 3. When the user clicks that cus

Re: KeyError: 'default'

2015-04-07 Thread Mike Dewhirst
On 7/04/2015 8:48 PM, Flavia Missi wrote: Hi, From Django 1.6 to Django 1.7 /migration**/handling was added to Django, so I suppose you cannot run your project with 1.7 without performing the required changes. If you're using south, take a look here: https://docs.djangoproject.com/en/1.7/topics

Re: Issues downloading documentation offline

2015-04-07 Thread Tim Graham
Hi Nkansah, Just wanted to acknowledge that I'm aware of these issues and am looking into it. I believe the latter issue needs to be resolved on the readthedocs end. See https://github.com/django/django/pull/4436 for some discussion. Tim On Tuesday, April 7, 2015 at 6:35:26 PM UTC-4, Nkansah

Re: Model with two e-mail fields uniques

2015-04-07 Thread victor menezes
Would it be a bad approach to use a ManyToMany with properties null/blank False? class Email(models.Model): email = models.EmailField(unique=True) def __unicode__(self): return self.email class Person(models.Model): first_name = models.CharField(max_length=100) last_name