Re: [Model, ORM] Disabling a field before actually removing it

2019-06-21 Thread George Silva
The answer is indeed to split this into steps. First step is to allow the field to be nullable if it's not already. Deploy. Then you create a new deploy (not PR) that stops using the field altogether from all the codebase. You can remove the reference to the field or comment it out. Do not

Re: Using React Native

2018-06-29 Thread George Silva
For Django, yes. For React Native and Machine Learning? Not so much. On Fri, Jun 29, 2018 at 10:22 AM musonda makena wrote: > sorry thought i was in the right place where you can ask any question > about Django and etc. was redirected here when i was doing my research on > Django > > On Friday,

Re: Using React Native

2018-06-29 Thread George Silva
I don't mean to be disrespectful, but you are asking the wrong questions in the wrong place. That being said, the maturity of machine learning libraries and tools available in Python are far greater than in other languages like PHP. Now React or React Native does not have anything to do with

Re: New Add-On: Django Model Lifecycle Hooks

2018-03-31 Thread George Silva
>From Reading the readme this looks promising. Congrats! I might use this soon. Em sáb, 31 de mar de 2018 15:50, Robert Singer escreveu: > Hey there - > > I just wanted to let community know about a small add-on I wrote in order > to add Rails-style hooks/callbacks to

Re: Bokeh Server via Django Tutorial

2017-11-08 Thread George Silva
Cool! I just played with it and good job. Good for demonstration purposes! On Wed, Nov 8, 2017 at 2:56 PM, Jonathan Bennett wrote: > I created a tutorial that demonstrates how to create and host a Django > Website that serves interactive Bokeh Server plots. > > The

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

Re: Will function based views ever be deprecated?

2017-04-01 Thread George Silva
In the end, cbvs are functions. So no, I don't they come to an end soon. I love function based views. Em 2 de abr de 2017 12:37 AM, "Some Developer" escreveu: > Hi, > > I was wondering if function based views will ever be deprecated? I > absolutely hate class based

Re: GeoDjango: strip z dimension; force 2D

2016-12-19 Thread George Silva
There is a way to coerce the input to 2d. It's not pretty, but it works. from django.contrib.gis.geos.prototypes.io import wkt_w wkt = wkt_w(dim=2).write(input_geom).decode() geom = GEOSGeometry(wkt, srid=4674) Imagine that you get input_geom from somewhere. In our case it was coming from a KML

Re: Unable to set up celery in supervisord

2016-07-22 Thread George Silva
Besides, if you see > https://github.com/celery/celery/blob/3.1/extra/supervisord/celeryd.conf, > there's no mention of environment variables. > > > Regards, > Ankush Thakur > > On Fri, Jul 22, 2016 at 10:34 PM, George Silva <georger.si...@gmail.com> > wrote:

Re: Unable to set up celery in supervisord

2016-07-22 Thread George Silva
Check the docs. There's plenty of information regarding this. It's probably a bad formatted character, misplaced comma or whatever. On Fri, Jul 22, 2016 at 1:49 PM, Ankush Thakur wrote: > Well, setting up the line this way gives me the following error: > > Starting

Re: Unable to set up celery in supervisord

2016-07-22 Thread George Silva
The secret key contains % chars. Chance them to something else or escape them. Em 22/07/2016 13:49, "Ankush Thakur" escreveu: > Well, setting up the line this way gives me the following error: > > Starting supervisor: Error: Format string >

Re: Unable to set up celery in supervisord

2016-07-21 Thread George Silva
If you are getting variables from the environment, supervisor that special environment directive. The variables need to specified in the supervisor conf file, such as: command=/home/ankush/jremind/env/bin/celery --app=remind.celery:app worker --loglevel=INFO

Re: Migrate command does not respect options for db connections?

2015-06-02 Thread George Silva
Any news? Hello? On Sat, May 30, 2015 at 4:28 PM, George Silva <georger.si...@gmail.com> wrote: > Context: > > Django 1.7.1 > PostgreSQL 9.4 > > I have the following database entry in settings: > > DATABASES = { > 'default': { > 'ENGINE': 'dj

Migrate command does not respect options for db connections?

2015-05-30 Thread George Silva
Context: Django 1.7.1 PostgreSQL 9.4 I have the following database entry in settings: DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis', 'NAME': 'xpto', 'USER': 'postgres', 'PASSWORD': 'postgres', 'HOST': 'localhost',

Re: django deployment in a virtual machine.

2015-02-24 Thread George Silva
not production i hope. in prod use nginx. if not on prod use runserver 0.0.0.0:8000 Em 24/02/2015 18:37, "dk" escreveu: > I got a virtual machine with Linux centos that we are going to use for our > django webpage. > that machine will have the html service on. so when people

Re: Django 1.7 migrate for postgres fails: Charfield to ForeignKey

2015-02-20 Thread George Silva
check merge migrations. some migrations the framework will combine whenever possible. Em 20/02/2015 17:15, "Martin Kapfhammer" escreveu: > Yep, I can drop the column and create a new one as integer. > The only problem I have is that creating the field as a char was in

Re: Django 1.7 migrate for postgres fails: Charfield to ForeignKey

2015-02-20 Thread George Silva
The deal here is that the model Currency has an ID, which is well, integer. Your data that is already on that column, is char (original field). If you are not in production, I would recommend dropping the field (comment the code), make migrations and apply. that will remove the currency column.

Re: Seems like a geodjango bug with multiple databases

2015-02-19 Thread George Silva
I'm using with success two postgis enabled databases on a single application, without quirks. I have a read-only database, and a read/write database. No problems, so far. On Thu, Feb 19, 2015 at 5:11 PM, Collin Anderson wrote: > Hi, > > Interesting. What version of django

Re: Is this good django practice?

2015-02-09 Thread George Silva
I use this technique often. I have a few scenarios where I need to convert data before presenting them to the user, and I use that. I have used that to even join tables that live on separate databases (via Postgres FDW) and present them to the user in a map or a table-view. If this takes a lot

Re: django doubt

2015-01-27 Thread George Silva
what? english, please. Em 27/01/2015 12:13, "termopro" escreveu: > > Purpose well, libs clean, u happy. > If don't use, don't use - problem no. > The diff is some syntx sugr/ abilty do thngs ezly. > > On Tuesday, January 27, 2015 at 9:15:19 AM UTC+2, Kadhir Mani wrote: >> >>

Re: django doubt

2015-01-27 Thread George Silva
Virtualenv helps you isolate between environments. Imagine that you work where you need to develop and maintain two applications. One is written in Django.1.5 and the other one on Django 1.7. How do you install two versions of Django inside your system python environment? You can't. That's what

Re: Disorientated by too many google-maps django packages

2015-01-26 Thread George Silva
I would suggest a new approach here. Don't use a package that is out there. Since your task is quite simple, you should create you webmapp using JavaScript, and pull all the patient data from your django server using REST or use a map server, like GeoServer, to create and render your layers on

Re: Django's query result caching

2014-12-01 Thread George Silva
You can convert your spatial results to WKT and store them in redis. On Mon, Dec 1, 2014 at 2:45 PM, termopro wrote: > I am creating a website using Django 1.7 and GeoDjango. I've hit the point > when i need to optimize website speed. > > One of the bottlenecks is query

Re: is it worth going for version 1.6 for commertial project

2014-11-25 Thread George Silva
I'm using the new migrations system with a production system and it's been great. No complaint at all. On Tue, Nov 25, 2014 at 11:24 AM, Collin Anderson wrote: > Hi All, > > If it helps, at work we have upgraded all of our websites to django 1.7, > and are only now

Re: POSTGIS_VERSION error

2014-08-11 Thread George Silva
You need a PostGIS database. That means a PostgreSQL server installed and running, with PostGIS installed. That syntax, of file name, only works for sqlite3 database provider. On Mon, Aug 11, 2014 at 9:46 AM, wrote: > Hi all, > > I am a newbie to Django and in

Re: Beginning with a feature flag system

2014-07-07 Thread George Silva
Django Waffle is very good. On Mon, Jul 7, 2014 at 5:07 PM, sk wrote: > Hello All, > > I would like to try out one of the feature flag libraries available for > Django. So far I have come across Gargoyle - a feature flag library and > cannot wrap my head around as to how it

Re: Django Dying upon loop

2014-06-20 Thread George Silva
You can use the raw() function to create a adhoc query to the database. Check the documentation and write proper sql code. It will be much more efficient. On Fri, Jun 20, 2014 at 12:44 PM, G Z wrote: > There instead of looping through the queries i do it all in one loop but >

Re: Connection with third database using multidb implementing DB Router

2013-11-08 Thread George Silva
configured in settings.py as the alias. Like this: class ModelInAnotherDatabase(models.Model): name = models.CharField() objects = ExternalManager(alias="external") Where external is the database name configured in settings.py. On Fri, Nov 8, 2013 at 3:11 PM, Ovnicraft <ovnicr...

Re: Connection with third database using multidb implementing DB Router

2013-11-08 Thread George Silva
I only had to query external databases. I've created my models as managed=False and implemented a custom manager that redefined the default database configuration. We did not had situations where depending on a certain condition the target database would change, but this worked just fine. On

Re: Django project - Allow users to write a custom function and store in DB

2013-02-15 Thread George Silva
Very cool. Please post some notes about whole thign. On Fri, Feb 15, 2013 at 2:34 PM, Robin Fordham wrote: > Hi guys, > > Thanks for all the pointers! > > George / Bob - That's exactly the pointer I needed 'exec' or 'eval' > > Ryan - Celery is something I have been

Re: Django 1.4.1, multiple geometry fields problem

2012-10-02 Thread George Silva
:49 AM, Jani Tiainen <rede...@gmail.com> wrote: > I guess all this is related to special munging required by Oracle: > > https://code.djangoproject.**com/ticket/10888<https://code.djangoproject.com/ticket/10888> > > > 2.10.2012 15:12, George Silva kirjoitti: >

Re: Django 1.4.1, multiple geometry fields problem

2012-10-02 Thread George Silva
Then it's probably Oracle, which is riddled with bugs on the spatial part. I'm using PostGIS. On Tue, Oct 2, 2012 at 8:38 AM, Jani Tiainen <rede...@gmail.com> wrote: > > 2.10.2012 14:34, Jani Tiainen kirjoitti: > > 2.10.2012 14:06, George Silva kirjoitti: >> >>&g

Re: Django 1.4.1, multiple geometry fields problem

2012-10-02 Thread George Silva
This is puzzling. I'm on 1.4.1 and I have models with two geometric columns, without a hitch. The only interesting thing I can see is that you are using SRID = settings.4326 on extent. Is that correct? On Tue, Oct 2, 2012 at 7:52 AM, Jani Tiainen wrote: > Hi, > > I've

Re: How to separate data having the same model but belonging to different users?

2012-09-28 Thread George Silva
Use unit tests so you DO NOT FORGET to user the userid filter. You're going to walk a thousand miles to get something somewhat working and that it won't solve all your problems. At least, resolving the "forgetting the filter" issue is easy to solve. When you database starts to creep with tables

Re: GeoDjango and shapefiles

2012-09-20 Thread George Silva
Hi Coulson, GeoDjango is just Django. You can write an application that checks upon initialization which type of environment it's located and then you can set the DATABASES property on settings.py. Using the technique I've told you above, you can store GIS data in two databases (for web

Re: How many attempts to generate a unique ID?

2012-09-09 Thread George Silva
Do you need this identifier to be so short? If that's not a problem, why don't you use something tried and that's proven that will succeed: GUIDS (or UUIDs). http://en.wikipedia.org/wiki/Globally_unique_identifier http://docs.python.org/library/uuid.html On Sun, Sep 9, 2012 at 8:10 PM, Anton

Re: Dynamic forms

2012-07-30 Thread George Silva
I think that he does NOT want to use jQuery ("java Query"). Without javascript you will need to resubmit data to the server, so he figures out what to do. On Mon, Jul 30, 2012 at 5:58 PM, Marshel Helsper wrote: > The only way I can think of doing it without JS would be by

Re: Prioritise 0.1 released

2012-07-14 Thread George Silva
HI Jon, Congratulations of your first public Django project. It seems very useful. Nice coding style, good follow of the guidelines, etc :D. THe only thing missing that I've found are unit tests, since they might demonstrate to the public how much your product is reliable and incentivate usage.

Re: Does Django guarantees to generate well Optimized SQL Query ??

2012-05-18 Thread George Silva
Yes and no. Django provide mechanisms that you will minimize hits to the database. Check for select_related function for example. George On Fri, May 18, 2012 at 1:00 PM, shariq wrote: > Hi, > I am writing an Django application. > This project need to be very efficient

Re: Best Practices for Changing Data Model

2012-05-10 Thread George Silva
Hi Mark, There are some projects that aim to reduce friction in this process. I recommend that you take a look at django-south. It can handle all of that plus some other interesting things, using administration commands. On Thu, May 10, 2012 at 12:28 PM, Mark Phillips

Re: Django - Worldwide Developer Rates - Hourly Income - location and project duration specific

2012-05-07 Thread George Silva
This is interesting but I think the media for the poll is a little off. Maybe we could use Google tools to collect data? Or SurveyMonkey? On Mon, May 7, 2012 at 1:09 PM, Raphael wrote: > ** > In the mean while it would be useful if you could provide more data

Re: Confused about GeoDjango and PostGIS

2012-04-25 Thread George Silva
Yes it can, as long PostGIS is installed. On Wed, Apr 25, 2012 at 2:37 PM, vishy wrote: > So, the existing database cannot be used as a postgis db? > > On Apr 25, 9:21 pm, Jeff Heard wrote: > > Create a new spatial database and import the

Re: Django + Windows Server 2003 + IIS6 + MSSQL 2005

2012-04-17 Thread George Silva
If you are tied up to the Windows platform (not that it is bad, it does some good stuff, actually, it's just different) I suggest that you consider using other solution stack. If it's a must that Django + IIS + SqlServer, then you will need to sweat and work a lot to get your project running.

Re: South tutorial is not working

2012-04-13 Thread George Silva
Post part of your settings .py here. On Fri, Apr 13, 2012 at 6:51 PM, alex3627 wrote: > Hi, > > I added the following line in the section of INSTALLED_APPS of my > settings.py: > > 'south', > > then I ran "python manage.py syncdb" giving this error: > >

Re: Django Unittesting Question.

2012-02-28 Thread George Silva
You need to use the tearDown method to clear any records that you've might create. On Tue, Feb 28, 2012 at 8:10 AM, Johan wrote: > Hi. I can see that the setUp method of my TestCase specialization is > being run for each test case. I thought that the test DB is cleared >

Re: ANN: OGC Web Feature Service for GeoDjango

2012-01-31 Thread George Silva
Wow! Congratulations on this release. I'm looking at it right now. :D On Tue, Jan 31, 2012 at 1:11 PM, Jeff Heard wrote: > https://github.com/JeffHeard/ga_ows > > http://geoanalytics.renci.org/uncategorized/ogc-wfs-for-django-released-on-github/ > > It's not

Re: my models are remembering old fields that I have since deleted

2011-05-07 Thread George Silva
Just drop the old tables and run syncdb again! Cheers On Sat, May 7, 2011 at 10:45 PM, Nick Arnett wrote: > > > On Sat, May 7, 2011 at 6:05 PM, Dug_the_Math_Guy > wrote: > >> HI I'm new to Django and just getting some models going. I started >>

Problem with Geometries

2011-05-02 Thread George Silva
Hello guys I'm having a problem with Geodjango, a weird exception happening, not sure why. Well, my setup is the following: Windows 7 64bit GeoDjango installed from Windows Installer. Here is a traceback when I try to store a common object using the admin http://dpaste.com/538214/ My model

Re: How to build a social network

2011-04-20 Thread George Silva
Your question is sorta of naive. With Django or Ruby you can build any kind of websites. Your software must provide it to be "a social network". First of all, as others recommended, learn webprogramming. CSS, HTML are a must. Now for the "social" aspect of the thing, it will depend on your

Re: DB-Views or read-only tables in models

2011-01-25 Thread George Silva
Perhaps you could override the save method and make it like this: def save(self,*args,**kwargs): pass Would that work? This is also a curiosity I have, but didn't have a chance to test it. Any thoughts? George On Wed, Jan 26, 2011 at 12:22 AM, Russell Keith-Magee < russ...@keith-magee.com>

Re: Django Graphics

2010-12-02 Thread George Silva
Perhaps you can process/display CAD drawings using PostGIS + OpenLayers? On Thu, Dec 2, 2010 at 8:36 AM, Shamail Tayyab wrote: > Have you also tried the python's imaging library? > > You can easily make any type of images in PIL and the display them as > images in browser.

Re: Are AutoField primary keys re-used after deleting an object from the db?

2010-10-09 Thread George Silva
I'm pretty sure that OID is not reused. It's database behavior to control this and my guess is that Django does not use old object ids. Futhermore there is a simple test that you can do: Create a new object, delete it. Create a new object and check it's id. George On Sat, Oct 9, 2010 at 9:51

GeoDjango installer not working

2010-09-09 Thread George Silva
Hello guys, The GeoDjango installer for windows is not working. When I try to execute it I get an error, saying that file is possibly corrupted. Is it me or is the file damaged? Thanks -- George R. C. Silva Desenvolvimento em GIS http://blog.geoprocessamento.net -- You received this