Communication between listboxes in form

2015-01-22 Thread joulumaa
Hi, beginner question. I need to have two listboxes A and B on web page, When user selects one item from A it should add it in B. If I understand right, form A should somehow save change to database and wake up form B to update its query. Where should I start in documentation? -thanks --

Re: {% url ... %} does not work for callable?

2015-01-22 Thread Torsten Bronger
Hallöchen! Torsten Bronger writes: > I cannot get the following working: > > In urls.py: > > url(r"^samples/(?P.+)/edit/$", sample.edit), > > In the template: > > {% url 'samples.views.sample.edit' sample_name="whatever" %} > > I constantly get a NoReverseMatch, I solved the probem; it d

Dynamically show or hide form fields?

2015-01-22 Thread Tobias Dacoir
In my Signup form the user has to chose his languages and afterwards his proficiency in that language. So based on the selection from forms.ChoiceField it should display one of two other ChoiceFields. Example: Language = English -> Display English Proficiency below Language = German -> Disp

Re: Dynamically show or hide form fields?

2015-01-22 Thread Tobias Dacoir
ok, seems I'm stupid. The fields already have an id set, so I should be able to use javascript. Sorry for asking this stupid question. Still if someone has valid points as why I should use a different solution please let me know. -- You received this message because you are subscribed to the G

Re: Data migration fails because contenttypes not yet ready

2015-01-22 Thread Daniel Hahler
Hello, I was having the same issue as Torsten: it does not appear to be possible to load initial data related to contenttypes or auth during migrations. As for the problem with contenttypes reported by Torsten, a workaround appears to be calling `update_all_contenttypes` manually from your mig

Accessing Django test client in setUpClass

2015-01-22 Thread Nicole Harris
I just posted this on Stack Overflow and then realised I might have more luck here. Basically, I'd like to know if I can access self.client inside setUpClass(cls) when setting up a Django test: http://stackoverflow.com/questions/28084683/accessing-django-test-client-in-setupclass If anybody has

Re: Data migration fails because contenttypes not yet ready

2015-01-22 Thread Markus Holtermann
Hi, first of all, both, update_all_contenttypes and create_permissions, expect their respective app to be migrated completely in order to work as of 1.7.4 (https://github.com/django/django/commit/478546fcef38d95866a92bc44d10e15b26c7254c). The "serialize model manager in migrations" issue, whic

Django with ExtJs, any app ?

2015-01-22 Thread Fellipe Henrique
Hello, There's any app to make easier manipulate data using Django and ExtJ? T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ * *GitHub: https://github.

django select extremely slow on large table

2015-01-22 Thread Joris Benschop
Dear List, I'm trying to run a simple select on a very large Oracle table (1500 million records). I create a standard django model: -- class Marker(models.Model): marker_id = SYSGUID16Field(primary_key=True) # This field type is a guess. markid = models.CharField(uniqu

Re: django select extremely slow on large table

2015-01-22 Thread SK
To many calculations in the from_db_value function. Need optimizations. And what about query limitations: 1.5b is really needed? class SYSGUID16Field(models.Field): default_error_messages = { 'invalid': "'%(value)s' is not a valid SYS_GUID." } description = "A connector to the SYS_GUID

Re: django select extremely slow on large table

2015-01-22 Thread Joris Benschop
Thanks you for your response Unfortunately, yes, the 1.5b records is not something I have control over. I agree the SYSGUID field needs working. However, if I change this field to any other field type, the query still takes over 40 seconds. class Marker(models.Model): marker_id = models.Binar

Unable to save object with images while using FormWizard in Django 1.7 and Python 3.4

2015-01-22 Thread Frankline
​Hi all​, I am having a problem saving a Django form using the *FormWizard * while using *Django 1.7* and *Python 3.4*. Below is my code: *models.py* ...class Advert(models.Model): ... # Some irelevant code removed for

Refactoring normal view into class based view

2015-01-22 Thread akash nayyar
Hi guys any idea how the following view could be refactored into class based view? I want to convert this view into more structured class based view. def student_application(request, project_slug): profile = StudentProfile.objects.get(user=request.user) project = Project.objects.get(slug=

Re: makemigrate adds multiple migrations.AddField for same model (django 1.7.1)

2015-01-22 Thread pjotr
I created ticket for this: https://code.djangoproject.com/ticket/24203 On Friday, December 26, 2014 at 9:54:52 PM UTC+1, Collin Anderson wrote: > > Ohh, I see. Yes, this looks like a possible spot for optimization. I > wouldn't really call it a "bug", but a "cleanup/optimization". You could > pr

Django & Ember.js issue tracker

2015-01-22 Thread Rafał Pitoń
I've decided to start issue tracker on github to list all gotchas and differences between Ember.js defaults and conventions vs. Django ones I have encountered so far as well as solutions and fixes for those: https://github.com/rafalp/django-ember-issues I currently have file on two things her

Suggestions Required

2015-01-22 Thread Aayush Aggarwal
I am developing an Web Application that basically does data analytics,so need suggestions how should i go about this? Also is it advisable use RPy2 to interface with R from Python? Any other suggestions? Thanks! -- You received this message because you are subscribed to the Google Groups "

Slow test startup under Django 1.7

2015-01-22 Thread Warren Smith
I'm in the process of converting a large legacy app from Django 1.5 to 1.7. I've got all the tests passing, so I'm researching an issue I noticed during the course of my work: Test startup takes MUCH longer under Django 1.7 than it did under 1.5. I've got a test that, when run by itself, took a

Re: Slow test startup under Django 1.7

2015-01-22 Thread Markus Holtermann
Hey Warren, this is a known problem in 1.7. It is fixed in 1.8 (see https://code.djangoproject.com/ticket/23745). Unfortunately, the changes made to reduce the amount of get_models() and render() calls are too invasive to backport them to 1.7. If you have the time, could you try running your p

Re: Communication between listboxes in form

2015-01-22 Thread Russell Keith-Magee
On Thu, Jan 22, 2015 at 4:17 PM, joulumaa wrote: > Hi, beginner question. > > I need to have two listboxes A and B on web page, When user selects one > item from A it should add it in B. > > If I understand right, form A should somehow save change to database and > wake up form B to update it

Re: Accessing Django test client in setUpClass

2015-01-22 Thread Russell Keith-Magee
Hi Nicole, (I've added this answer to SO as well) Short answer is no - but that's not the end of the story. self.client is a convenience that is configured as part of the "pre-test" sequence. This means it is configured on a per-test basis; so you can use it in setUp(), but not setUpClass(). Ho

Re: How to use password hasher snippet in Django?

2015-01-22 Thread Supermario
Many thanks for your help Thomas. Indeed I am in the middle of big escape effort to get the heck away from Drupal. I tested your snippet in the shell and DrupalPasswordHasher hashes perfectly well there. However, when I integrate the hash into my project as per your explanation, django-regist

Re: How to check appname via Django commands?

2015-01-22 Thread Collin Anderson
Hi, I don't think the project name is stored in the database. You can sometimes access the project name this way: settings.SETTINGS_MODULE.split('.')[0] Collin On Tuesday, January 20, 2015 at 6:33:38 AM UTC-5, Sugita Shinsuke wrote: > > Hello Vijay > > Thank you for replying. > > But, I want t

Re: OneToOne field versus model inheritance

2015-01-22 Thread Collin Anderson
Hi, Django doesn't really provide a way to create a subclass from an already existing object in the admin. It's actually pretty hard to do even in the code. So for that reason I'd recommend the non subclass with the OneToOneField. Actually, if I were doing it, this is what I would do: class U

Re: Binding model data to a formset without POST

2015-01-22 Thread Collin Anderson
Hi, Interesting. I've never heard of someone wanting to show validation errors on the initial data when the page first loads. I have however wanted to manually bind data to a form before. Last time I checked it's not super trivial, because you could for instance have a SplitDateTimeWidget whic

Re: Is Django suitable for this purpose?

2015-01-22 Thread Collin Anderson
Hi, As others have mentioned, it's totally possible. Regardless of using Django or not, the integration could easily be the hardest part, and that's where the "up to a minute delay" could come in. Collin On Tuesday, January 20, 2015 at 4:52:33 PM UTC-5, Mike Taylor wrote: > > I want to have an

Re: Strange Behavior from the Django Admin (following tutorial on a shared server)

2015-01-22 Thread Collin Anderson
Hi, What's likely happening is that django or passenger is crashing. Is there any log available? Collin On Wednesday, January 21, 2015 at 2:13:45 AM UTC-5, Ed Volz wrote: > > Hi all, > > New to Django so I was following along with the tutorial and can get to > the point of logging into the Adm

Re: block php requests

2015-01-22 Thread Collin Anderson
Hi, I had broken link emails enabled for a while. Over time, my nginx.conf config grew into this: location /_vti_inf.html { return 404; } location /crossdomain.xml { return 404; } location ~/cache/eb91756ae6745d22433f80be4ec59445$ { return 404; } # some sort of plugin? location

Re: Remote Authentication (out-of-the-box)

2015-01-22 Thread Collin Anderson
Hi, RemoteUserBackend is for Apache or Windows IIS, I don't think it's what you want. Do you have a local copy of the user table on hand? If so just query the matching username and call "django.contrib.auth.login()" on it. Otherwise, you'll need to use a custom backend. Collin On Wednesday,

Re: makemigrations complains about a ForeignKey not being Unique

2015-01-22 Thread Collin Anderson
Hi, I think you might want to use a common abstract base class. You want a completely separate database table for the two models, right? Collin On Wednesday, January 21, 2015 at 10:17:08 PM UTC-5, Samuel Jean wrote: > > Hi there, > > Does anybody know of a way to trick Django 1.7 (or the prope

Re: How to use password hasher snippet in Django?

2015-01-22 Thread Tom Lockhart
On Jan 22, 2015, at 4:42 PM, Supermario wrote: > Many thanks for your help Thomas. Indeed I am in the middle of big escape > effort to get the heck away from Drupal. > > I tested your snippet in the shell and DrupalPasswordHasher hashes perfectly > well there. > > However, when I integrate t

Re: sending email

2015-01-22 Thread Collin Anderson
Hi, Just query the users you want. to_emails = [u.email for u in User.objects.filter(username__in=['person1', 'person2', 'person3'])] send_mail('Subject here', 'Here is the message.', from_email_address, to_emails) Collin On Wednesday, January 21, 2015 at 11:29:51 PM UTC-5, suabiut wrote: > >

Re: django select extremely slow on large table

2015-01-22 Thread Tim Chase
On 2015-01-22 17:14, Joris Benschop wrote: > Thanks you for your response > Unfortunately, yes, the 1.5b records is not something I have > control over. [snip] > WHERE "PROD_SCHEMA"."MARKER"."MARKID" = :arg0 Just out of curiosity, do you have an index on MARKER.MARKID ? And if so, is it combined

Re: Django with ExtJs, any app ?

2015-01-22 Thread Jani Tiainen
Hi, Easier on what sense? I've had great success with django-rest-framework and ExtJS as is for a long time, without need to have an app to do anything for me. On Thu, 22 Jan 2015 13:17:09 -0200 Fellipe Henrique wrote: > Hello, > > There's any app to make easier manipulate data using Django a

Re: django select extremely slow on large table

2015-01-22 Thread Jani Tiainen
Hi, 1.5b rows is rather big data. Could you test what .values() or .values_list() produces in terms of speed. also print qs might actually pull in all selected records in Python memory so it may take a while to constuct bunch of objects. On Thu, 22 Jan 2015 07:32:36 -0800 (PST) Joris Benschop

Re: django select extremely slow on large table

2015-01-22 Thread Anssi Kääriäinen
Do you fetch all the results when running the query directly against Oracle? Many Oracle SQL clients do not fetch all the results, instead they fetch just the top 100 or so rows. - Anssi On Thursday, January 22, 2015 at 5:32:36 PM UTC+2, Joris Benschop wrote: > > Dear List, > > I'm trying to r

Re: django select extremely slow on large table

2015-01-22 Thread Anssi Kääriäinen
Do you fetch all the results when running the query directly against > Oracle? Many Oracle SQL clients do not fetch all the results, instead they > fetch just the top 100 or so rows.markid = > models.CharField(unique=True, max_length=20, blank=True) > I missed the part where you said you a

Re: django select extremely slow on large table

2015-01-22 Thread James Schneider
How many results do you typically get back from that query? It sounds like the DB is highly optimized if you can gather results from tables that large that quickly running the query outside of Django. If you are returning a large dataset, then it is more likely that Django is furiously coercing ev