Django admin inline forms

2014-03-26 Thread Andreas Kuhne
Hi all, I have 2 models that look something like this: class Address(models.Model): address_row1 = models.CharField(max_length=200, null=True, blank=True) address_row2 = models.CharField(max_length=200, null=True, blank=True) postal_code = models.CharField(max_length=30, null=True, bl

How transform specific geometry column using Django GIS GeoQuerySet

2014-03-26 Thread Shoaib Ijaz
I am trying to transform geometry column type in django, here is my model class Network(models.Model): name = models.CharField(max_length=50, blank=True) alias = models.CharField(max_length=100, blank=True) geometry = models.GeometryField(srid=3857, null=True, blank=True) bbox =

Re: How transform specific geometry column using Django GIS GeoQuerySet

2014-03-26 Thread Shoaib Ijaz
Sorry i mistype queries Network.objects.transform(srid=3857).values('geometry', 'bbox') > > SELECT ST_Transform("tbl_network"."geometry", 3857), "tbl_network"."bbox" > FROM "tbl_network" > > Network.objects.transform(srid=3857).values('bbox') > > SELECT "tbl_network"."bbox" FROM "tbl_networ

IntegrityError --- NOT NULL constraint failed: books_book.publication_date

2014-03-26 Thread Sami Razi
i'm learning django using djangobook , in chapter 6, i'm having this error: IntegrityError at /admin/books/book/add/ NOT NULL constraint failed: books_book.publication_date it seems i should set null=True for publication_date field. but i did it alrea

Re: IntegrityError --- NOT NULL constraint failed: books_book.publication_date

2014-03-26 Thread Sam Walters
Did you perhaps change the schema of the database after you had created it. Eg: added null=True as a constraint after creating the table? If so check the db sheme using: python manage.py sqlall It sounds simple enough. You will have to go into the db shell and update your schema manually. usin

Re: IntegrityError --- NOT NULL constraint failed: books_book.publication_date

2014-03-26 Thread Sami Razi
i used python manage.py sqlall you're right sam, when i set null to true, it doesn't really change. thank you so very much. i'm a newbie with databases and i don't know what statements sould i use... i don't know the syntax... i would install south. thank you. thank you so very much. but i'm

How to keep each field changes history?

2014-03-26 Thread sanmugasundaram k
Hi, I want to keep the history of each field changes. I think to do this , Insert one more record with changes. To check the changes, i want to check each field or Django having any function. If i am wrong correct me. Thanks, Sanmugam -- You received this message because you are subscribed to

the best ways export datas for my project

2014-03-26 Thread carlos
Hi all, What is de best ways for export data? for example i have 3 apps, but apps 1 and 2 have relation with apps 1 and i want download data in only one file all data APP1 class Model1(...): field1 = field2 = ... -- APP2 class Model2(): fk = (

Making functions callable

2014-03-26 Thread Anthony Hawkes
Hi Guys, I'm running into a problem with django(I guess this would also affect Python in general) where if I create a view eg def view(year=today.year()) The year is never re-evaluated until the server is reloaded/restarted I'm trying to figure out how to make a callable method accessible as a

Re: Making functions callable

2014-03-26 Thread John DeRosa
For the default value to work as you expect, do this: def view(request, year=None): if year is None: year = today.year() Kwarg defaults are evaluated when the module is interpreted for the first time. John On Mar 26, 2014, at 1:57 PM, Anthony Hawkes wrote: > Hi Guys, > > I'm ru

Re: How to keep each field changes history?

2014-03-26 Thread Mike Dewhirst
On 27/03/2014 5:00am, sanmugasundaram k wrote: Hi, I want to keep the history of each field changes. I think to do this , Insert one more record with changes. To check the changes, i want to check each field or Django having any function. If i am wrong correct me. A quick google found ... htt

Re: the best ways export datas for my project

2014-03-26 Thread Mike Dewhirst
On 27/03/2014 5:01am, carlos wrote: Hi all, What is de best ways for export data? for example i have 3 apps, but apps 1 and 2 have relation with apps 1 and i want download data in only one file all data APP1 class Model1(...): field1 = field2 = ... -

Re: Making functions callable

2014-03-26 Thread Anthony
Thanks John, I've yet to test it but I read a few people stating to use lambdas variables/properties. Is it definitely the case that it will only evaluate once? Either way I've embarked on the mission to make methods return as properties and have found @property decorator to fit my needs, the iss

Re: Making functions callable

2014-03-26 Thread Mike Dewhirst
On 27/03/2014 7:57am, Anthony Hawkes wrote: Hi Guys, I'm running into a problem with django(I guess this would also affect Python in general) where if I create a view eg def view(year=today.year()) The year is never re-evaluated until the server is reloaded/restarted I'm trying to figure out ho

Re: Making functions callable

2014-03-26 Thread John DeRosa
Not sure what is going on without seeing the code. But something is None when it should be a string, as the exception is telling you. It's often easiest to try out problem code interactively in Python, and zero in on the problem. John On Mar 26, 2014, at 3:53 PM, Anthony wrote: > Thanks Joh

Re: Making functions callable

2014-03-26 Thread Javier Guerra Giraldez
On Wed, Mar 26, 2014 at 5:53 PM, Anthony wrote: > I've yet to test it but I read a few people stating to use lambdas > variables/properties. Is it definitely the case that it will only evaluate > once? from the python docs (2.7): Default parameter values are evaluated when the function definiti

Referring to the page -- https://docs.djangoproject.com/en/1.6/intro/tutorial01/

2014-03-26 Thread Dan Sveaver
https://docs.djangoproject.com/en/1.6/intro/tutorial01/ I've looked at this several times, and I was hoping to get the proverbial set of extra eyes. I made it almost to the bottom of the page, but while I'm in the Python shell, I type the following: >>> p = Poll.objects.get(pk=1) >>> p.was_pub

Re: Making functions callable

2014-03-26 Thread Anthony Hawkes
Thanks Guys, especially Javier! I've spent so much time trawling Google for this info! On Thursday, 27 March 2014 04:57:30 UTC+8, Anthony Hawkes wrote: > > Hi Guys, > > I'm running into a problem with django(I guess this would also affect > Python in general) where if I create a view eg > def vi

Re: Geodjango and Python 3.3

2014-03-26 Thread Alex Mandel
You might get more responses on the GeoDjango mailing list: geodja...@googlegroups.com I agree the basic libraries probably all work. Are you sure you used OSGeo4w with Python3? OSGeo4w ships 2.7.x, so unless the GDAL and GEOS wrappers also work with Python3 that sounds odd. pypi page makes it lo

Re: How transform specific geometry column using Django GIS GeoQuerySet

2014-03-26 Thread Alex Mandel
On 03/26/2014 06:28 AM, Shoaib Ijaz wrote: > Sorry i mistype queries > > Network.objects.transform(srid=3857).values('geometry', 'bbox') >> >> SELECT ST_Transform("tbl_network"."geometry", 3857), "tbl_network"."bbox" >> FROM "tbl_network" >> >> Network.objects.transform(srid=3857).values('bb

Re: Referring to the page -- https://docs.djangoproject.com/en/1.6/intro/tutorial01/

2014-03-26 Thread Shai Efrati
Hi Dan, In the shell, did you re-import your Poll model? (>>> from polls.models import Poll) I think you might use a previous version of your model (without the changes), and that's why it doesn't recognize it. I might be wrong though :) Please let me know if it worked. Shai. On Thu, Mar 27