Deprecating model field (Deleting model field, but keeping DB column)

2017-07-05 Thread taylor
I am having some trouble figuring out the best way to remove model fields in Django. If I remove a field from a model and then run makemigrations, it creates a RemoveField operation in a migration. That is great, but if I decide to run the migration before releasing the new code, the existing c

count the selected checkboxes in a multipleselectfield

2017-07-05 Thread elloy
Please, I need your help because I'm trying to solve a problem I'm making a questionnaire and I want to count the number of the selected choices in a certain question The model I'm using is: class Reuse(models.Model): REUSE_OPTIONS = ( ('1', 'first choice'), ('2', 'second cho

How do I model a 'paper object' that should have reviewers?

2017-07-05 Thread Denis Cosmin
I need to create an journal like application, where users can submit papers and those papers can be reviewed. My code is publicly available on github and the app is about ~50 done. The reviewers should also be users of the same app and they should be able to comment and perhaps give a rating. (I w

count the selected chechboxes in multipleselectfield

2017-07-05 Thread elloy
I need your help with a problem I'm trying to solve I'm making a questionnaire and I have to count the selected choices that the user have checked in a certain question with 5 possible answers(choices) The model I'm using is: class Reuse(models.Model): REUSE_OPTIONS = ( ('1', 'first c

Re: Keep logged in accross Sites

2017-07-05 Thread Pablo Camino Bueno
Hi Constantine, Do you know how to implement this? I'd need to login the user in a domain that is not the one the view was reached from. Could it be building a custom authentication backend that somehow logs the user in all the sites? El domingo, 2 de julio de 2017, 0:16:10 (UTC+2), Constan

Re: Deprecating model field (Deleting model field, but keeping DB column)

2017-07-05 Thread Avraham Serour
you can remove the field and don't run migrations until you are ready to actually remove the column, or you may run migrations fake and leave the column there forever https://docs.djangoproject.com/en/1.11/ref/django-admin/#cmdoption-migrate-fake On Wed, Jul 5, 2017 at 6:39 AM, wrote: > I am ha

Re: Deprecating model field (Deleting model field, but keeping DB column)

2017-07-05 Thread taylor
Thanks for responding Avraham. That would be a good option if I was developing by myself, but I am working with a team of 20 developers. The process needs to be the same whether there are deprecated fields or not. I can't realistically expect 20 people to not apply one migration (or a few speci

Re: Deprecating model field (Deleting model field, but keeping DB column)

2017-07-05 Thread Jani Tiainen
Hi, Sounds like your all developers do use same database if you have such a problems. It's usually good practice to have per developer development database. That will allow individual developers to do changes to database and migrate others as they please. Also it doesn't "matter" if one deve

Re: Deprecating model field (Deleting model field, but keeping DB column)

2017-07-05 Thread Avraham Serour
>From what you are describing it seems that you are planning for the long term. which I don't believe is ideal You may mark the whole model as not managed, but I don't think you can mark just one field and unmanaged. Another simple approach would be to transform the attribute to a property and pri

Re: Keep logged in accross Sites

2017-07-05 Thread Larry Martell
On Wed, Jul 5, 2017 at 7:25 AM, Pablo Camino Bueno wrote: > Hi Constantine, > > Do you know how to implement this? I'd need to login the user in a domain > that is not the one the view was reached from. > > Could it be building a custom authentication backend that somehow logs the > user in all th

Re: count the selected chechboxes in multipleselectfield

2017-07-05 Thread Bob Gailer
On Jul 5, 2017 6:55 AM, "elloy" wrote: > > I need your help with a problem I'm trying to solve > I'm making a questionnaire and I have to count the selected choices that the user have checked in a certain question with 5 possible answers(choices) > The model I'm using is: > > class Reuse(models.Mo

Re: django-tables2 and javascript

2017-07-05 Thread yingi keme
Thanks... Yingi Kem > On 4 Jul 2017, at 9:45 PM, Владислав Котвицкий > wrote: > > Sorry, i dont know django-tables2, but i try use DOJO framework DataGrid and > this framework have all mechanism > > вторник, 4 июля 2017 г., 23:31:04 UTC+3 пользователь yingi keme написал: >> >> I want to kno

Re: django-tables2 and javascript

2017-07-05 Thread yingi keme
Thanks James. Yingi Kem > On 4 Jul 2017, at 11:55 PM, James Schneider wrote: > > > > On Jul 4, 2017 1:31 PM, "yingi keme" wrote: > I want to know. How do you access a table generated by django-tables2 in your > client side using javascript? > > Does django-tables2 provide a mechanism to ac

Re: count the selected chechboxes in multipleselectfield

2017-07-05 Thread elloy
On Wednesday, July 5, 2017 at 3:59:41 PM UTC+3, bob gailer wrote: > > On Jul 5, 2017 6:55 AM, "elloy" > wrote: > > > > I need your help with a problem I'm trying to solve > > I'm making a questionnaire and I have to count the selected choices that > the user have checked in a certain question wi

Django channels for single user

2017-07-05 Thread yingi keme
How will you create a web socket for a single user such that another program can send a json data to thesame specific user open channel. What i normally see is: Html script: var mysocket = new WebSocket('ws://' + window.location.host + '/users/'); routing.py: channel_routing = [route("websock

Re: Deprecating model field (Deleting model field, but keeping DB column)

2017-07-05 Thread taylor
Avraham, Thanks for your answer again. When you say planning for the long term is not ideal, what do you mean? I am interested in learning better processes. I do currently work with 20 developers, if that is what you meant. Your approach with a property was my first attempt. That didn't work be

Re: Django channels for single user

2017-07-05 Thread Andrew Godwin
Yes, you should create a group per user. That way users with more than one tab open will get data sent to all tabs too. Andrew On Wed, Jul 5, 2017 at 6:42 AM, yingi keme wrote: > How will you create a web socket for a single user such that another > program can send a json data to thesame speci

Re: Deprecating model field (Deleting model field, but keeping DB column)

2017-07-05 Thread Thomas Lockhart
> On Jul 4, 2017, at 8:39 PM, tay...@cedar.com wrote: > > I am having some trouble figuring out the best way to remove model fields in > Django. If I remove a field from a model and then run makemigrations, it > creates a RemoveField operation in a migration. That is great, but if I > decide t

Re: Django channels for single user

2017-07-05 Thread yingi keme
So how do you create a group for a single user? What is the syntax like? If you have a site that opens a connection for every user. What is going to be the argument for: Group(argument).add(message.reply_channel) Yingi Kem > On 5 Jul 2017, at 3:30 PM, Andrew Godwin wrote: > > Yes, you should

Re: Django channels for single user

2017-07-05 Thread yingi keme
Okk. I have tried it. What happens is that When it starts the HANDSHAKING, it DISCONNECTS. So the websocket doesnt connect. Any reason why that is happening.? Yingi Kem > On 5 Jul 2017, at 3:30 PM, Andrew Godwin wrote: > > Yes, you should create a group per user. That way users with more than

Django-oscar ModuleNotFoundError 'apps\\checkout'

2017-07-05 Thread Bernard Oosthuizen
I am trying to *fork* one of the apps of django-oscar so that I can customize it. I followed all the instructions on django-oscar docs All the files are created when I run python manage.py oscar_fork_app

Django + React: Shared Model Consistency

2017-07-05 Thread Guilherme Leal
I'm starting a new project that uses Django (with DRF) as backend and React as frontend but I have some concerns about data consistency across what the API endpoints might expect, and what the client with React could provide. Exemple: Lets say I have the following model: class Person(models.Mode

Re: Django + React: Shared Model Consistency

2017-07-05 Thread George Silva
Hello Guilherme, The easy way is provide an endpoint with valid values for that relation. Other than that, the client doesn't need to know about that. He can post anything and you can answer back with the errors. If he posts, for example, an invalid gender, you can validate that in your DRF and j

Re: Django + React: Shared Model Consistency

2017-07-05 Thread Guilherme Leal
>>The easy way is provide an endpoint with valid values for that relation. That ideia crossed my mind more than once, but that adds at least 1 more api call (which already tends to be numerous in most cases), and while I can, will avoid that route. >>Other than that, the client doesn't need to kn

Re: Deprecating model field (Deleting model field, but keeping DB column)

2017-07-05 Thread Alceu Rodrigues de Freitas Junior
It seems to me more a organization/project management isssue that something that should be handled by Django itself. Well, if I got the problem correctly, that is. It seems you can't remove the field from the Model class because that would remove the column from the underline table itself as s

Re: Django + React: Shared Model Consistency

2017-07-05 Thread Alceu Rodrigues de Freitas Junior
Never used Django REST Framework (DRF) before, but I guess you're trying to achieve something that should be handled by your API documentation. It crossed my mind that you're looking for describing the payload your REST API expects and that should be done dinamically by the consumer. Never saw

Re: Django + React: Shared Model Consistency

2017-07-05 Thread Guilherme Leal
Alceu, thanks for the idea. DRF already have (something like) that [1]. Like I said to George, I'm trying to avoid the "request the metadata from the api call" aproach, as it tends to bloat the client with metadata requests. I'm looking for something lke a design pattern or a development tool. Bu

Noobie question, can't get url request to work, 404

2017-07-05 Thread ahickman3
So I literally just started django, I know 0 about backend dev, but im going through the djangobook tutorial (also, please excuse me if I use the wrong syntax). He shows us how to get content to show up on our temporary domain (a simple Hello World). The hello world setup looks like so, with th

Re: Noobie question, can't get url request to work, 404

2017-07-05 Thread johnf
to be honest I haven't used Django in a while so take what I'm saying as wrong - but shouldn't the url be url(r'hello/$', views.hello, name='hello'), Not sure you need "^" although I doubt it hurts. Johnf On 07/05/2017 02:23 PM, ahickm...@tamu.edu wrote: So I literally just started django, I

Re: Noobie question, can't get url request to work, 404

2017-07-05 Thread Alceu Rodrigues de Freitas Junior
You forgot to say what is going wrong... I guessing you're getting a: Page not found (404) Request Method: GET Request URL:http://127.0.0.1:8000/ Using the URLconf defined in |noobie.urls|, Django tried these URL patterns, in this order: 1. ^admin/ 2. ^hello/ The empty path di

Re: Noobie question, can't get url request to work, 404

2017-07-05 Thread ahickman3
oh wow that was it, i wasnt reading the instructions correctly, i clearly said to go to /hello. Sorry about that, and thanks! On Wednesday, July 5, 2017 at 4:38:24 PM UTC-5, Alceu Rodrigues de Freitas Junior wrote: > > You forgot to say what is going wrong... I guessing you're getting a: > Page

Re: Deprecating model field (Deleting model field, but keeping DB column)

2017-07-05 Thread taylor
I am sorry everyone. I guess I am not very good at explaining the problem. I will try explain it better. Please ignore everything I have written before because it seems to be confusing. I have perfectly working code in production. Later, I want to make a model change to remove a field and updat

Re: django webframework

2017-07-05 Thread Anish Chapagain
Hi, You can start learning about Django from https://www.djangoproject.com/start/ do follow it's individual sections step-by-step. It will guide you from *Installing *to *deploying *Web Application, look thru the Tutorials section and have some play around. Some prior knowledge of Python pr

Re: Deprecating model field (Deleting model field, but keeping DB column)

2017-07-05 Thread Jani Tiainen
Hi, Well, seems that your deployment process needs fixing. Simplest option is to stop serving site (put it to maintenance mode to show for example static maintenance page), update codebase and run migrations. Restart servers and put django serving back. If you're looking zero downtime migrat