I did a simple workaround for this.
http://stackoverflow.com/a/26691861/926961
but in my opinion it should get fixed somehow without workarounds :)
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receivi
Hello!
I've written on that topic here:
http://stackoverflow.com/questions/26688775/django-cant-discover-tests-correctly
What I discovered is:
- unittest.loader ignores directories which are provided manually in
settings to sys.path
- unittest.loader requires __init__.py in a directory to look t
Is it possible to split articles manually with some sort of a pagination tag
in the text?
Whole text:
Part 1:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
{{ split_tag.page1 }}
Part 2:
Vivamus sit amet odio a turpis congue tincidunt.
{{ split_tag.page2 }}
etc.
--
You received thi
I am trying to do a private subpage for every user which will be accessed
trough url:
url(r'^galeria/$', 'publisher.views.private_gallery'),
I was trying to create a query set for private gallery by using a signal:
user_logged_in
p = Publisher.objects.filter(status='p', pub_type='private_ga
Actually my code worked. Other code created some errors :)
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/Zr4vh5PEW5YJ.
To post to this group, send email t
I'am writing a thumbnail generator for my Images model
Everything is working fine apart from saving path to the database.
http://wklej.to/AimKm
Could you give me some hints on model overriding?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
T
I have an application which is designed for publishing blog posts etc.
I upload images but normally they are at the end of the text because they
are uploaded after I save the entry, that means I cant embedd them directly
inside the text.
Is there any way I can add new images directly inside the
You may merge the code in views.py and use 1 url for them.
You could use TemplateView() instead of render to response
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/djan
Thank you Bruce and Daniel both anwsers really helped me.
I really appreciate it :).
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/LkInATAnM28J.
To post
Ooops I meant source ;)
Firstly:
{{ p.source.all.0 }} - < gets source name, only first element (as proper
slice should work) but I still dont understand how to get all avaliable
elements for each source in publisher
Secondly:
{{ p.source.url.all.0 }} < does not get URL from Source.url, I reall
And also how do I display more objets from that list? ;) Sorry for double
post
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/FAgvFRzJpdIJ.
To post to thi
That worked but how do I acces other field called "url" which is in Category
model?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/1VxdFnovRNEJ.
To post t
The more time I spend with django, the more problems pop up :)
I dont fully understand how to access related fields between models. (FK or
ManyToMany)
Code:
http://pastebin.com/qbciYqYw
In code pasted below - {{p.souce.all}} returns source name but in that
form: [], instead of "Google".
Also I
Thanks for your responses.
How I can generate multilevel lists based on fields:
category
- subcategory
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/qS
.
2. My second problem is that I dont really understand how I can generate
multi-level lists.
{{ c.category }}
- {{ c.subcategory }}
Could someone explain how the loops should look like?
/// Petey
--
You received this message because you are subscribed to the Google Groups
"Django
Is it possible to bind two views to one url adress?
I have a generic view - detail_view and I prepared a form for comments.
Detail_views generates urls by "type", "pk", "slug" fields. Under each
publication I'd like to add a form to add my comments model and I dont
really know how I could do tha
Pagination templatetags do not fully work for my generic view and I dont
quite understand why.
http://pastebin.com/kyS0UciG
Only : {{ paginator.num_pages }} and {{ paginator.page_range }} works.
I noticed that in these methods are a bit different from for example:
{{page}} - when you import pa
Problem solved.
I was too tired to find my mistake earlier ;)
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/JJP1kz7lyZAJ.
To post to this group, send emai
Hey
I've made a view which should generate url in form like this
(example.com/type/id/slug : example.com/news/1/lorem-ipsum/)
To generate links I use:
{{ n.title|safe}}
It isn't the correct form for that as far as I know.
Could someone explain me how to use {% url %} tag in this situation? I d
Hi,
I have two models:
- Publisher - my main model
- Images - additional model for images
http://pastebin.com/VUNCzDye
In images model I have a link generator which displays absolute path for
uploaded images.
I use inline to add images for messages. I want to display admin_tumbnail
function as
I have a login/logout application - it works within its defined view
(login/views.py) and templates (templates/login/index.html).
I want to port this app so it will be displayed in base.html. The main
problem is that I don't really know how to import this app correctly to
base.html.
If I use c
I did it in a simple way ;)
I had seperate model class for images and I used inline models in admin
Take a look at code below:
models:
class News(models.Model):
title = models.CharField("Tytuł", max_length=256)
text = models.TextField("Treść")
date_added = models.DateTimeField(editabl
Hi.
I want to display images for news. Images class is a seperate model.
In generic view (index) to display news and images I use 2 "for" loops which
work.
In "single" view I use get_object_or_404 which changes a bit the template -
it does not require the loops to display the text.
If I unders
Both helped.
3rd problem to go ;)
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/1F7cf6lXgjMJ.
To post to this group, send email to django-users@googlegr
Hi
1. When in django.admin I want to pick a source from dropdown list it always
lists every item as "source object".
How I can modify it so it will show source_name from Source model?
from django.contrib import admin
from news.models import News, Comment, Source
class NewsAdmin(admin.ModelAdmin
I am just starting to do adminmodel and now I've noticed that it can be done
by this function and not models :)
I'll work a bit more on that tomorrow :)
Thanks for help I really appreciate it.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
Sorry for multiple messages but I think that I've accidently fixed it:
from django.db import models
from django.contrib.auth.models import User
from django.contrib.auth.signals import user_logged_in
import datetime
class News(models.Model):
text = models.TextField()
title = models.TextFie
Is there a way around?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/ZcWJm3heIOgJ.
To post to this group, send email to django-users@googlegroups.com.
To
The target of this is to automatically fill fields without users having to
chose "user".
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/nDHuq-HmLNcJ.
To p
I got an error even after removing my modifications to the source:
*ValueError at /admin/news/news/add/*
*invalid literal for int() with base 10: ''
*
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
h
Hey
I'am working on my models page and this is my code:
http://pastebin.com/eAyzzZuY
which returns an error:
django.core.management.base.CommandError: One or more models did not
validate:
news.news: Accessor for field 'created' clashes with related field
'User.news_se
t'. Add a related_name arg
Hi!
I've made a model in news application:
http://pastebin.com/49VkFT14
I want it to save user who created a message, however I get this message:
OperationalError at /admin/news/news/add/(1054, "Unknown column 'user_id' in
'field list'")
--
You received this message because you are subscribed
Is there a way to use the same authentication tables between multiple
sites? I want users on one of my websites to be able to use the same
login on another without duplicating the tables. Is this possible. I
couldn't tell if the add-on sites module could server that purpose or
not.
--~--~---
33 matches
Mail list logo