Re: allow certain users to access certain views

2015-02-18 Thread James Schneider
You should be able to handle this pretty easily with Django's built-in permission system. Just create a group, add the users to it, and assign the requisite permissions to the group. Our add the needed permissions individually to each user. https://docs.djangoproject.com/en/1.7/topics/auth/defaul

Sqlite3 to Postgres Migration?

2015-02-18 Thread talex
I have a functioning Django application that is based on sqlite3, but I want to change to using Postgres. I have altered the DATABASES clause in settings.py to use Postgres. and I am using Django version 1.7. Am I correct that use of "python makemigrations" followed by "python migrate", should co

allow certain users to access certain views

2015-02-18 Thread sum abiut
Hi, I have an app that i am trying to allow only certain users to access specific views. For example all users can view the home page but for a certain link. i only want to allow the HR manager to access it. Could you please point me to right direction. Cheers -- You received this message becau

Re: Django 1.7.4, PostgreSQL: Migrate FK to M2M?

2015-02-18 Thread Micky Hulse
Hi Andrew, many thanks for the quick reply and help! :) On Wed, Feb 18, 2015 at 8:56 PM, Andrew Pinkham wrote: > When I had to migrate FK->M2M, I found that hand-hacking a migration file was > the way to go. I wrote a multiple operation migration class that did the > following: > .. > Hope

Re: Django 1.7.4, PostgreSQL: Migrate FK to M2M?

2015-02-18 Thread Andrew Pinkham
Hi Micky, When I had to migrate FK->M2M, I found that hand-hacking a migration file was the way to go. I wrote a multiple operation migration class that did the following: 1. create a M2M, nullable field, and set all defaults to null 2. use RunPython to run a function which takes the data from t

Django 1.7.4, PostgreSQL: Migrate FK to M2M?

2015-02-18 Thread Micky Hulse
Hi, I was just curious if anyone could give me tips on how to migrate an FK to M2M whist retaining the FK selected data? Long story short, I've played around with adding adding a M2M field with a `related_name`, migrating, deleting FK, then re-naming the M2M and removing `related_name`, but I eve

Re: how to handle race conditions?

2015-02-18 Thread Waitman Gobble
On Wed, Feb 18, 2015 at 4:04 PM, Mario Gudelj wrote: > Great reply. You're a champion, Carl! > > On 19 February 2015 at 05:31, Carl Meyer wrote: >> >> Hi Abraham, >> >> On 02/17/2015 10:01 PM, Abraham Varricatt wrote: >> > I'm trying to make an app where folks can order X quantity of an item. >>

Re: html response to be loaded in a div

2015-02-18 Thread Vijay Khemlani
What is being sent to the view from the browser is fine, it's just being url encoded, the actual value is something like this then: [[['5E', '10A', '8D'], ['8B', '11B', '12G'], ['8C', '7B'], ['12C', '11F', '6A'],['5E', '10G', '10H'],['8A','11E'], ['7A', '12E', '12F'], ['5A', '11C', '12B','11G'], [

Re: Modify Installed_Apps settings

2015-02-18 Thread Andrew Pinkham
Thanks for the info, Joel. However, I'm trying to avoid creating a separate settings file. Any info about how to properly use modify_settings to add to installed apps or how to force the test runner to apply a specific migration would still be appreciated. Thanks, Andrew -- You received this

Re: how to handle race conditions?

2015-02-18 Thread Mario Gudelj
Great reply. You're a champion, Carl! On 19 February 2015 at 05:31, Carl Meyer wrote: > Hi Abraham, > > On 02/17/2015 10:01 PM, Abraham Varricatt wrote: > > I'm trying to make an app where folks can order X quantity of an item. > > The condition is that the order should only be made if inventory

Re: html response to be loaded in a div

2015-02-18 Thread Mario Gudelj
You may need to use | safe filter in your tag since your output is being encoded. E.g. {{output|safe}} Cheers, M On 19 February 2015 at 07:37, João Marques wrote: > This is what is being sent to the view: > > > %5B%5B%5B%275E%27,%20%2710A%27,%20%278D%27%5D,%20%5B%278B%27,%20%2711B%27,%20%271

Re: Modify Installed_Apps settings

2015-02-18 Thread Joel Goldstick
On Wed, Feb 18, 2015 at 2:03 PM, Andrew Pinkham wrote: > I have an app in Django 1.7.4 that I would like to use purely for testing. > > $ ./manage.py startapp override > > The app contains its own model, view, and URL pattern (the model overrides a > model in another app, allowing me to test

Re: html response to be loaded in a div

2015-02-18 Thread Thomas Rega
Hi, may be that this example(s) help: https://godjango.com/blog/working-with-json-and-django/ good luck 2015-02-18 21:37 GMT+01:00 João Marques : > This is what is being sent to the view: > > %5B%5B%5B%275E%27,%20%2710A%27,%20%278D%27%5D,%20%5B%278B%27,%20%2711B%27,%20%2712G%27%5D,%20%5B%278C%27

Re: html response to be loaded in a div

2015-02-18 Thread João Marques
This is what is being sent to the view: %5B%5B%5B%275E%27,%20%2710A%27,%20%278D%27%5D,%20%5B%278B%27,%20%2711B%27,%20%2712G%27%5D,%20%5B%278C%27,%20%277B%27%5D,%20%5B%2712C%27,%20%2711F%27,%20%276A%27%5D,%5B%275E%27,%20%2710G%27,%20%2710H%27%5D,%5B%278A%27,%2711E%27%5D,%20%5B%277A%27,%20%2712E%27,

Re: html response to be loaded in a div

2015-02-18 Thread João Marques
Thank you so much for all the answers so far. I must say that I totally failed not checking the method that both of you guys presented (just acessing the GET url on the browser). I actually gives me an *error*: ValueError(errmsg("Expecting value", s, err.value)) from None I've searched and it

Re: Release announcements?

2015-02-18 Thread Markus Holtermann
Hey Anton, You can find the release roadmap at https://code.djangoproject.com/wiki/Version1.8Roadmap The current plan is to issue the beta on Friday, given that all current release blockers are fixed. There is a topic about the 1.8 release blockers on the django-developers mailing list: https

Release announcements?

2015-02-18 Thread Anton Melser
Hi, I have started a new project on 1.8 and am looking for an RSS or mailing list that has release announcements for Django proper - is there anything? My understanding was that the first Beta was supposed to come out on the 16 Feb, is that right? Thanks! Anton -- You received this message b

Modify Installed_Apps settings

2015-02-18 Thread Andrew Pinkham
I have an app in Django 1.7.4 that I would like to use purely for testing. $ ./manage.py startapp override The app contains its own model, view, and URL pattern (the model overrides a model in another app, allowing me to test behavior in a specific case). For the moment, I have the app in I

Re: how to handle race conditions?

2015-02-18 Thread Carl Meyer
Hi Abraham, On 02/17/2015 10:01 PM, Abraham Varricatt wrote: > I'm trying to make an app where folks can order X quantity of an item. > The condition is that the order should only be made if inventory exists. > Assume that we have stock of Y items. This means that only if Y >= X > should we allow

Re: html response to be loaded in a div

2015-02-18 Thread Tom Evans
On Wed, Feb 18, 2015 at 1:27 PM, João Marques wrote: > Hey guys, so basicly I want to send a GET request with ajax to one of my > views and the specific view returns an html response that will be loaded on > a div. > The problem is that is doesn't seems to work at all. Nothing happers on the > div

Re: html response to be loaded in a div

2015-02-18 Thread Vijay Khemlani
When you access the AJAX resource directly from your browser ( http://127.0.0.1:8000//saveToDbAndReturn?sols=) are you also getting a blank page? Also try putting a print statement or debugging poing (using pdb) at the beginning of the controller and check if it is actually being called.

Re: html response to be loaded in a div

2015-02-18 Thread João Marques
Im getting nothing really... I just do alert(response); and nothing shows up. quarta-feira, 18 de Fevereiro de 2015 às 14:48:48 UTC, Vijay Khemlani escreveu: > > What is the actual content of the response you are getting from the AJAX > request? > > On Wed, Feb 18, 2015 at 10:27 AM, João Marque

Re: confirm_login_allowed in subclassed authentication returns wrong error message

2015-02-18 Thread Tomáš Sekanina
Thank you for your answer but I am not sure I understand your answer, can you explain why using the method described in docs does not work for this case? Dne úterý 17. února 2015 22:33:00 UTC+1 James Schneider napsal(a): > > You should raise the error in your custom user login form when attempt

Seems like a geodjango bug with multiple databases

2015-02-18 Thread Luan Nguyen
I'm using geodjango and multiple databases, and experiencing a quite weird situation, I guess it's a kind of bug but not absolutely sure since I'm pretty new to Django. Here is how to reproduce the problem: - Set up another database besides default: DATABASES = { 'default': { 'ENGINE' : 'django.

Re: html response to be loaded in a div

2015-02-18 Thread Vijay Khemlani
What is the actual content of the response you are getting from the AJAX request? On Wed, Feb 18, 2015 at 10:27 AM, João Marques wrote: > Hey guys, so basicly I want to send a GET request with ajax to one of my > views and the specific view returns an html response that will be loaded on > a div

Re: drop-in replacement for admin module foreign key relation UI

2015-02-18 Thread Derek
I think https://pypi.python.org/pypi/django-autocomplete-light is good, quick and stable. It has "heritage" (been around and battle-tested) and provides the features that are key. (And supports Django 1.7, Python3). On Tuesday, 17 February 2015 01:03:05 UTC+2, Jani Kajala wrote: > > Hi all, >

html response to be loaded in a div

2015-02-18 Thread João Marques
Hey guys, so basicly I want to send a GET request with ajax to one of my views and the specific view returns an html response that will be loaded on a div. The problem is that is doesn't seems to work at all. Nothing happers on the div. Please help me community! Thank you! *HTML to be filled

Re: Beginning Djangi

2015-02-18 Thread Jorge Andrés Vergara Ebratt
I think for this kind of questions you could benefit from checking https://www.djangosites.org/ There you can see a list of sites built with Django and get and idea of the kind of things you could do with it On Wed Feb 18 2015 at 7:49:02 AM Mukul Sharma wrote: > I am new to Django. I want to bu

Beginning Djangi

2015-02-18 Thread Mukul Sharma
I am new to Django. I want to build a news website with real time refreshing. So my question is, "is django enough to create this type of website?, or I do need something else also". I am familiar with JavaScript, HTML and CSS. -- You received this message because you are subscribed to the Goog

Re: ImportError

2015-02-18 Thread Petar Pilipovic
Ok, I will work on it as soon as posible, tnx for your help. On Wednesday, February 18, 2015, aRkadeFR wrote: > > On 02/18/2015 07:17 AM, Petar Pilipovic wrote: > > aRkadeFR I have one other question regarding urls.py. I got this error when I am trying to go from contact or about to home page. >

Re: ImportError

2015-02-18 Thread aRkadeFR
On 02/18/2015 07:17 AM, Petar Pilipovic wrote: aRkadeFR I have one other question regarding urls.py. I got this error when I am trying to go from contact or about to home page. Using the URLconf defined in |tryDjango.urls|, Django tried these URL patterns, in this order: 1. ^$ [name='home

Odesk , Freelancer Clone, Auction site in django

2015-02-18 Thread Michal Tomczakowski
Where can I find clones in django? something simmilar i can change in to Auction site? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and sto

Re: How to make a list-view sortable in frontend?

2015-02-18 Thread ThomasTheDjangoFan
Hi James, yeah - the data is displayed as a table.. django-tables2 looks awesome... I'm gonna give it a try. Are there any other solutions out there that you can recon? Am Dienstag, 17. Februar 2015 23:51:25 UTC+1 schrieb James Schneider: > > Are you displaying the data in a table? If so, I've

Re: how to handle race conditions?

2015-02-18 Thread aRkadeFR
Hello, My opinion on the problem: A database is ACID, so there will be no problem if every information are stored in the database. There should be a "available_quantity" property on a item. This will allow you to have more control of the stock too. If a customer put an item in his basket this ch