Thank you.
On Mon, Jun 15, 2015 at 10:37 PM, carlos <crocha09.09@gmail.com> wrote:
Hello, use two model and the second model inline one model exampleclass ModelA(...):name = charfield(...)class ModelB(....):fk(ModelA)image = imagefiel(...)caption = bla bla bladate = datefieldand them in admin.pyclass ModelBInline(admin.TabularInline):model = ModelBextra = 1class ModelAAdmin(admin.ModelAdmin):inlines = [ModelBInline]admin.site.register(ModelA, ModelAAdmin)CheersTo view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAM-7rO3ubHWOHVJT6wMjxrPag9G1-OBXDGev9g-RG8PWakzUtQ%40mail.gmail.com.--On Sun, Jun 14, 2015 at 1:08 AM, Carlos Arturo Sanchez Rivera <ing.casr@gmail.com> wrote:--It is easier with decorators@admin.register(Transfer)
class TransferAdmin(admin.ModelAdmin):
pass
El sábado, 13 de junio de 2015, 4:28:38 (UTC-5), Robin Lery escribió:admin.py:I have a model to upload pictures:
models.py:class Snap(models.Model):
image = models.ImageField(upload_to=get_upload_file_name)
caption = models.CharField(max_length=150, blank=True, null=True)
date = models.DateField(default=date.today)class SnapAdmin(admin.ModelAdmin):
class Meta:
model = Snap
admin.site.register(Snap, SnapAdmin)
In the admin it contains all theSnap's field (i.e. one field to upload an image ,its caption and the pubdate) which is as expected. How do I add multiple record ofSnap's in one go, without having to save it one by one. I hope I was clear, if not please ask. Your help and guidance will be very much appreciated. Thank you.
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+unsubscribe@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/5f3a3841-6605-4250-9299-ff4922c8421f%40googlegroups.com.
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+unsubscribe@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.
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+unsubscribe@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/CA%2B4-nGrbmmOrgCxjSUGdmwhBbbugvk%3DOYEBi-SXfswiNm5nS%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment