Re: can_introspect_default feature

2016-10-20 Thread Tim Graham
The 'default' model field option is used in Python rather than in the 
database. SchemaEditor might set a column default to ease populating a 
value on existing rows but that default shouldn't be left in the column's 
definition. self.assertIsNone(field.default) means that the column doesn't 
have a default.

On Thursday, October 20, 2016 at 8:29:29 AM UTC-4, Maximiliano Robaina 
wrote:
>
> Hi Tim,
>
> Thanks for response.
>
> El martes, 18 de octubre de 2016, 12:07:34 (UTC-3), Tim Graham escribió:
>>
>> Hi Maxi,
>>
>> Did you take a look at the relevant commit that introduced the flag?
>>
>> https://github.com/django/django/commit/75303b01a9cc900eebf1f27ba0bc6508334242fc
>>
>
> Yes, I was looking into this changeset, but I can't understand yet what 
> "And that the default is no longer set in the database." means in 
> test_add_field_default_dropped [1].
> field.default contains the column default definition not the default value 
> of the some table record, Is it that correct?, So, why this must be None?
>
>
>
> [1] 
> https://github.com/django/django/commit/75303b01a9cc900eebf1f27ba0bc6508334242fc#diff-888b45a0a8f38ee67e8d22403cf994dbR1371
>
>
> Regards 
>
>
>
>>
>> On Tuesday, October 18, 2016 at 9:51:46 AM UTC-4, Maximiliano Robaina 
>> wrote:
>>>
>>> Hi,
>>>
>>> How supposed to can_introspect_default must work?
>>>
>>> I'm working on django firebird backend and I'm trying to figured out how 
>>> this feature works, but the schema tests fails. 
>>> This default is at database level or django level?
>>>
>>> If I define a field with a default value, and do a metadata 
>>> introspection over this field to know if default value is defined, it 
>>> always returns True.
>>>
>>> I hope be clear (sorry for my bad english)
>>>
>>> ---
>>> Maxi
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/64ab186f-de5c-42c7-99c9-d3e89225877b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: can_introspect_default feature

2016-10-20 Thread Maximiliano Robaina
Hi Tim,

Thanks for response.

El martes, 18 de octubre de 2016, 12:07:34 (UTC-3), Tim Graham escribió:
>
> Hi Maxi,
>
> Did you take a look at the relevant commit that introduced the flag?
>
> https://github.com/django/django/commit/75303b01a9cc900eebf1f27ba0bc6508334242fc
>

Yes, I was looking into this changeset, but I can't understand yet what 
"And that the default is no longer set in the database." means in 
test_add_field_default_dropped [1].
field.default contains the column default definition not the default value 
of the some table record, Is it that correct?, So, why this must be None?



[1] 
https://github.com/django/django/commit/75303b01a9cc900eebf1f27ba0bc6508334242fc#diff-888b45a0a8f38ee67e8d22403cf994dbR1371


Regards 



>
> On Tuesday, October 18, 2016 at 9:51:46 AM UTC-4, Maximiliano Robaina 
> wrote:
>>
>> Hi,
>>
>> How supposed to can_introspect_default must work?
>>
>> I'm working on django firebird backend and I'm trying to figured out how 
>> this feature works, but the schema tests fails. 
>> This default is at database level or django level?
>>
>> If I define a field with a default value, and do a metadata introspection 
>> over this field to know if default value is defined, it always returns True.
>>
>> I hope be clear (sorry for my bad english)
>>
>> ---
>> Maxi
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/f2e735f6-967e-4391-8623-48c1f7e7d3b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.