Re: issues with get_initial() in CreateView?

2014-10-08 Thread Lachlan Musicman
Ok, I think it's because the modela is not passed in the POST data. Is there any way to set the modela field in the CreateView without needing it to be in the POST data? IE, set the field in the CreateView (because the value is known immediately by virtue of ), and leave it out of the ModelForm

positiveintegerfield - display value in add template & remove value in edit template

2014-10-08 Thread 6233114 6233114
I am a newbie and this question is sort of related to a question I asked not so long ago. I have a select list as part of a form stored in my models.py file as a positiveintegerfield, as shown below: class AchievementDetails(models.Model, FillableModelWithLanguageVersion):

issues with get_initial() in CreateView?

2014-10-08 Thread Lachlan Musicman
I'm struggling with CreateView get_initial() in django1.7 I have a modelA detail page with an "add ModelB" (modelB has FK to ModelA) button. When I hit that button, I want the new ModelB obj to have the modelA FK set. So in the ModelB CreateView I have a get_initial that uses the slug to set the

Re: display text value of a positiveintegerfield

2014-10-08 Thread 6233114 6233114
Wow so easy (when you know where to look). Thank you! On Thursday, 9 October 2014 13:58:35 UTC+11, 6233114 6233114 wrote: > > I am a newbie. I have searched the django docs for this answer, but I > failed to find a reference, so here is my question. > > I have a select list as part of a form

Re: Upgrading Django (to 1.7)

2014-10-08 Thread Andrew Pinkham
Hi, Upgrading Django (to 1.7) Part III: Django 1.7's New Features is now available! For the article: afrg.co/updj17/a3/ For all of the material: afrg.co/updj17/ Any feedback appreciated. I hope you find the material helpful. Andrew -- You received this message because you are subscribed

Re: Upgrading Django (to 1.7)

2014-10-08 Thread Andrew Pinkham
Hi Fred, Thanks again for the input! Glad you liked Part II. Andrew -- 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.

Re: display text value of a positiveintegerfield

2014-10-08 Thread Mike Dewhirst
On 9/10/2014 1:58 PM, 6233114 6233114 wrote: *How do I display the text value of the saved select list value?* For example if the user has saved 2 as the achievement_type, how do I display *Academic Achievement* and not the number 2. Easy ...

Re: django UserAdmin

2014-10-08 Thread Sachin Tiwari
> > Hi Collin, > Thanks, I did some mistake, its working. -- 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

display text value of a positiveintegerfield

2014-10-08 Thread 6233114 6233114
I am a newbie. I have searched the django docs for this answer, but I failed to find a reference, so here is my question. I have a select list as part of a form stored in my models.py file as a positiveintegerfield, as shown below: class AchievementDetails(models.Model,

Re: Unable to import 3 modules when running tests

2014-10-08 Thread James Cheong
Hi Mike I've had a similar problem and couldn't find much help online. But finally found the cause of the problem. Try this fix: https://bitbucket.org/cramm/django-sqlserver/commits/d3a4e28a2768cb7729e788087889bf32806dfffb It's pretty much bypassing the import errors. Hope it helps! Cheers --

Re: Multi-table inheritance models not working for me

2014-10-08 Thread Collin Anderson
You want non-abstract inheirtance, and you can use parent_link to control the OneToOneField. https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.OneToOneField.parent_link -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Decrypting Encrypted Customer Data from Django Queries Not Working, But Working with Regular DB Queries

2014-10-08 Thread Collin Anderson
Do you need to re-initialize your decryptor each time in your django for loop, like you do in pure python? Are you sure you're using the same database and key? Is the base64 decoded, encrypted data the same between pure python and django before you decrypt it? Same python version? Do you have

Multi-table inheritance models not working for me

2014-10-08 Thread Martin Torre Castro
Hello, I want to make a hierarchy over a DB design as described in "Fundamentals of database systems" from Elmasri & Navathe. This implies that when I have some info which is shared for many classes/tables, I can put it in a main parent table and use the main table id as foreign key in the

Re: Decrypting Encrypted Customer Data from Django Queries Not Working, But Working with Regular DB Queries

2014-10-08 Thread G Z
I'll post some more on this later, I'll post comments and be more descriptive. On Wednesday, October 8, 2014 4:56:27 PM UTC-6, G Z wrote: > > I know exactly what my code is doing, and it works in just python > something django is doing is screwing it up. > > On Wednesday, October 8, 2014

Re: Decrypting Encrypted Customer Data from Django Queries Not Working, But Working with Regular DB Queries

2014-10-08 Thread G Z
I know exactly what my code is doing, and it works in just python something django is doing is screwing it up. On Wednesday, October 8, 2014 4:41:43 PM UTC-6, Cal Leeming [iops.io] wrote: > > Encrypting data such as passwords is one acceptable use case. However > encrypting other types of data,

Re: Decrypting Encrypted Customer Data from Django Queries Not Working, But Working with Regular DB Queries

2014-10-08 Thread Cal Leeming [iops.io]
Encrypting data such as passwords is one acceptable use case. However encrypting other types of data, such as name/phone numbers etc, is poor because you lose many search/indexing capabilities. For example, you wouldn't be able to perform wildcard searches, you could only do "case sensitive +

Re: Decrypting Encrypted Customer Data from Django Queries Not Working, But Working with Regular DB Queries

2014-10-08 Thread G Z
How is encrypting at the application level wrong? The research I have done, says that application level encrypting is better because its encrypted over a link, and this is why most web apps use the salt method. I would love to hear more about what your talking about I'm still learning. Also

Re: Decrypting Encrypted Customer Data from Django Queries Not Working, But Working with Regular DB Queries

2014-10-08 Thread Cal Leeming [iops.io]
For the record, this approach towards data security is completely wrong. Consider using FDE on your databases, rather than encrypting individual fields. Cal On Wed, Oct 8, 2014 at 11:11 PM, G Z wrote: > so I have a database of information with encrypted customer names. When

Decrypting Encrypted Customer Data from Django Queries Not Working, But Working with Regular DB Queries

2014-10-08 Thread G Z
so I have a database of information with encrypted customer names. When I use a plain python script to decrypt the names it works correctly and decrypts all of the customer names. However, when I used Django it will decrypt only one name and the remaining names will still be encrypted. I

Re: Django form build.

2014-10-08 Thread Collin Anderson
You'll probably want to look at formsets: https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#django.forms.models.BaseModelFormSet Can products belong to multiple companies? If not, I recommend having a models.ForeignKey(Company) on your Product model instead of the ManyToManyField.

Django form build.

2014-10-08 Thread Tsolmon Narantsogt
Hello everyone , im new in django. So i wanna add multi product on company. my question is how to build product form. (adding multi) a. class Company(models.Model): product=models.ManyToManyField(Product,verbose_name = u'Products') Thanks. -- You received this message because you are

Re: django email client (reusable app) kickstarter

2014-10-08 Thread Subodh Nijsure
Why does it need to have dependence on specific database postgres? Subodh On Oct 8, 2014 5:43 AM, "Internet Profil Filip Kowalski" < bi...@internetprofil.pl> wrote: > Hi, > > I have started kickstarter campaign: >

Closing modal when user sign up or login

2014-10-08 Thread Muhammed Tüfekyapan
Hello everyone, I have a form. All users see this form. My needs is like this; - If user logged in, save their settings. - If user doesn't logged in, first show him a modal - If he login or sign up, close modal and save their settings. (settings shouldn't be lost.) For now my template looks

Re: django UserAdmin

2014-10-08 Thread Collin Anderson
> > It gives same type of error. > Interesting. What did the error say? -- 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 UserAdmin

2014-10-08 Thread Sachin Tiwari
Hi Collin, It gives same type of error. -- 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

Re: Advice on template, list of objects from several models

2014-10-08 Thread Collin Anderson
I'd personally try to get all of that stuff in _one_ database model if possible, with a "type" char field. That makes queries and ordering very easy. Otherwise, yes, the next best option would be to have a database model that holds the ordering information and is somehow related to each model.

Re: How to implement chained/related dropdown lists in a page

2014-10-08 Thread Collin Anderson
I haven't done it much, but, yeah, ajax is probably best. Maybe something like might work: $('#id_category').change(function(){ var category = $(this).val() // not sure about this. the point is, get the selected id. $.get('/subcategory-options/?category=' + encodeURIComponent(category),

django email client (reusable app) kickstarter

2014-10-08 Thread Internet Profil Filip Kowalski
Hi, I have started kickstarter campaign: https://www.kickstarter.com/projects/112336300/open-source-email-client-based-on-python-and-djang The aim is to create an email client based on Python/Django which would be shared as open source. It would be easy to implement in projects and simple to

Re: django UserAdmin

2014-10-08 Thread Collin Anderson
What happens with my code? Did you try the lowercase version of user.smsregistration.phone_no and putting the string "phone_no" in list_display? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: cant pass the "CSRF verification failed. Request aborted." error

2014-10-08 Thread Collin Anderson
> > cant pass the "CSRF verification failed. Request aborted." error Does it say why? > and looks like if you use the "render" function should be the easiest way > since will take care of everything. > I also tried removing the tags from the html and I still get the error. > Exactly. Does

Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-08 Thread shmengie
On Tuesday, October 7, 2014 5:20:26 PM UTC-4, Bovine Devine wrote: > > Thanks for the help Collin...I need to read through more of the > documentation it seems! Going through the chapter am I correct in > understanding that using ModelForm example you listed as a view does not > need to be

Re: TemplateSyntaxError

2014-10-08 Thread Erik Cederstrand
Den 08/10/2014 kl. 06.04 skrev Petar Pilipovic : > Hi all, I am currently under going a blog tutorial from > http://matthewdaly.co.uk/blog/2014/01/02/django-blog-tutorial-the-next-generation-part-2/, > and I am stuck whit makrdown, I am aware that Django not supporting it any

TemplateSyntaxError

2014-10-08 Thread Petar Pilipovic
Hi all, I am currently under going a blog tutorial from http://matthewdaly.co.uk/blog/2014/01/02/django-blog-tutorial-the-next-generation-part-2/, and I am stuck whit makrdown, I am aware that Django not supporting it any more, but to keep things short I am geting this error.

Re: django UserAdmin

2014-10-08 Thread Sachin Tiwari
On Tuesday, October 7, 2014 2:16:53 PM UTC+5:30, Sachin Tiwari wrote: > > Hi, > > I added an extra field phone number in existiing user model and now I > tyring to access that field by below method, > > UserAdmin.list_display = ('email', 'first_name', 'last_name','is_staff', >

Re: django UserAdmin

2014-10-08 Thread Sachin Tiwari
On Tuesday, October 7, 2014 2:16:53 PM UTC+5:30, Sachin Tiwari wrote: > > Hi, > > I added an extra field phone number in existiing user model and now I > tyring to access that field by below method, > > UserAdmin.list_display = ('email', 'first_name', 'last_name','is_staff', >