Re: Admin options are just ignored

2014-08-12 Thread Collin Anderson
> This is not in the documentation this way. Can anyone update this?
See the note here:
https://docs.djangoproject.com/en/1.6/ref/models/fields/#django.db.models.DateField.auto_now

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFO84S5oEaSGafF2zjhCyrGCGarK2a_k6ZQHRSXb0gkn%2BhZFkQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin options are just ignored

2014-08-12 Thread somenxavier
Yes, it's.
Thank you very much.

This is not in the documentation 

 
this way. Can anyone update this?

El dilluns 11 d’agost de 2014 21:03:31 UTC+2, Collin Anderson va escriure:
>
> it could be an issue with auto_now, as only the database should be 
> editing that field and it shouldn't be editable through the admin. 
>
> Try adding this to your ResguardAdmin: readonly_fields = 
> ['data_modificacio'] 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/419c07c9-0008-4584-92cd-225e81b21569%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin options are just ignored

2014-08-11 Thread Collin Anderson
it could be an issue with auto_now, as only the database should be
editing that field and it shouldn't be editable through the admin.

Try adding this to your ResguardAdmin: readonly_fields = ['data_modificacio']

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFO84S69fxzgLfNtOFe-KfCLSX82QoUZ%3D6xFCoyLB-g7g%2BYfeg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin options are just ignored

2014-08-11 Thread somenxavier
Yes, I'm pretty sure. You can see here 

 
my models. No 'modificacio'

And
$ grep -R "modificacio"
serviedre/tasques/models.py:data_modificacio = 
models.DateTimeField(auto_now=True,verbose_name="data de modificació") # 
automàtic
serviedre/tasques/models.py:ordering = ['ref', 'titol', 'estat', 
'tipus', 'prioritat', 'data_modificacio', 'component']
serviedre/tasques/admin.py:('Data', {'fields': ['data_creacio', 
'data_resolucio']}), # falta data_modificacio
serviedre/tasques/admin.py:list_display = ('__str__', 'estat', 'tipus', 
'prioritat', 'data_modificacio', 'component', 'edat')
Hi ha coincidències en el fitxer binari 
serviedre/tasques/__pycache__/admin.cpython-34.pyc
Hi ha coincidències en el fitxer binari 
serviedre/tasques/__pycache__/models.cpython-34.pyc
Hi ha coincidències en el fitxer binari serviedre/dades.sqlite3


El dilluns 11 d’agost de 2014 19:38:48 UTC+2, Collin Anderson va escriure:
>
> is data_modificacio a real field on your model? (not just a method?) 
>
> are you using a custom form? 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ffcf170f-dd9a-442e-8953-cba1eec2c9bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin options are just ignored

2014-08-11 Thread Collin Anderson
is data_modificacio a real field on your model? (not just a method?)

are you using a custom form?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFO84S5Pz_MBq6z-zq%3DAfN9sZri6SVkTXU%3DaptGz18S74NWbng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin options are just ignored

2014-08-11 Thread somenxavier
Mmm.. sorry. I did not see that.

One more error: after making these changes 
,
 
I receive 

FieldError at /admin/tasques/resguard/1/ 

Unknown field(s) (data_modificacio) specified for Resguard. Check 
fields/fieldsets/exclude attributes of class ResguardAdmin.


in http://localhost:8000/admin/tasques/resguard/1/


If I have
class ResguardAdmin(admin.ModelAdmin):
fieldsets = [
(None,   {'fields': ['ref', 'titol']}),
('Estat', {'fields': ['estat', 'resolucio', 'tipus', 'prioritat']}),
('Data', {'fields': ['data_creacio', 'data_resolucio']}), # falta 
data_modificacio
('Classificació', {'fields': ['etiquetes', 'component', 'fites', 
'installacio']}),
('Descripció', {'fields': ['sintaxi_cos', 'cos']}),
('Referències', {'fields': ['referencies']}),
('Informació adjunta', {'fields': ['adjunts', 'codis']}),
]
list_display = ('__str__', 'estat', 'tipus', 'prioritat', 
'data_modificacio', 'component', 'edat')
search_fields = ['titol', 'cos']

all is ok

but if I put
class ResguardAdmin(admin.ModelAdmin):
fieldsets = [
(None,   {'fields': ['ref', 'titol']}),
('Estat', {'fields': ['estat', 'resolucio', 'tipus', 'prioritat']}),
('Data', {'fields': ['data_creacio', 'data_resolucio', 
'data_modificacio']}),
('Classificació', {'fields': ['etiquetes', 'component', 'fites', 
'installacio']}),
('Descripció', {'fields': ['sintaxi_cos', 'cos']}),
('Referències', {'fields': ['referencies']}),
('Informació adjunta', {'fields': ['adjunts', 'codis']}),
]
list_display = ('__str__', 'estat', 'tipus', 'prioritat', 
'data_modificacio', 'component', 'edat')
search_fields = ['titol', 'cos']

then, the error.

What's wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f8e7a4e1-6cdb-4329-9865-f237abeae122%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin options are just ignored

2014-08-11 Thread James Bennett
It is there in the documentation.

The first instance just uses "admin.site.register(Poll)" because it hasn't
yet begun customizing.

Once it starts explaining customization, it tells you, in that section:

https://docs.djangoproject.com/en/1.6/intro/tutorial02/#customize-the-admin-form

to change it to "admin.site.register(Poll, PollAdmin)".

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAL13Cg950%3DcNdtFF0XtgmS8wSNS5xM%3De7KVk0L44rHV8QqCpkA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin options are just ignored

2014-08-11 Thread somenxavier
Thank you very much. You're right.
In the official documentation there is no reference of that (step 2 
). Can anyboydy 
add it?

Thanks,

El dilluns 11 d’agost de 2014 0:02:34 UTC+2, Adrian Marshall va escriure:
>
> Think I found the problem. 
> You're not registering the new Admin model classes you have made. 
>
> change: admin.site.register(Resguard)
> to this:
> admin.site.register(Resguard,ResguardAdmin)
>
> do the same with the rest of your admin.site.register() functions
>
> That should work! Hope that helps!
>
> On Sunday, August 10, 2014 3:09:36 PM UTC-4, somen...@gmail.com wrote:
>>
>> Hi,
>>
>> I'm following the django tutorial with my application. When I add 
>> fieldset, search_fields, and other options in the admin.py in my app, 
>> django-admin ignores that.
>>
>> You can see the source code [here](
>> https://github.com/somenxavier/serviedre-tasques/tree/master/serviedre)
>>
>> Can anyone take a look. Thanks in advance,
>> Xan
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bad64743-cc06-4daa-ae5b-f5cff8a15c93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin options are just ignored

2014-08-10 Thread Adrian Marshall
Think I found the problem. 
You're not registering the new Admin model classes you have made. 

change: admin.site.register(Resguard)
to this:
admin.site.register(Resguard,ResguardAdmin)

do the same with the rest of your admin.site.register() functions

That should work! Hope that helps!

On Sunday, August 10, 2014 3:09:36 PM UTC-4, somen...@gmail.com wrote:
>
> Hi,
>
> I'm following the django tutorial with my application. When I add 
> fieldset, search_fields, and other options in the admin.py in my app, 
> django-admin ignores that.
>
> You can see the source code [here](
> https://github.com/somenxavier/serviedre-tasques/tree/master/serviedre)
>
> Can anyone take a look. Thanks in advance,
> Xan
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e1108a01-1644-4ba8-bc84-370441e1a0e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Admin options are just ignored

2014-08-10 Thread somenxavier
Hi,

I'm following the django tutorial with my application. When I add fieldset, 
search_fields, and other options in the admin.py in my app, django-admin 
ignores that.

You can see the source code 
[here](https://github.com/somenxavier/serviedre-tasques/tree/master/serviedre)

Can anyone take a look. Thanks in advance,
Xan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ba7bfa32-2e55-4544-86d6-7227ab5590db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.