Re: Django test discovery and RuntimeError: Conflicting 'entry_tags' models in application 'entries': and .

2014-11-01 Thread Petey
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

Django test discovery and RuntimeError: Conflicting 'entry_tags' models in application 'entries': and .

2014-11-01 Thread Petey
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

Django - pagination - split articles manually?

2011-10-22 Thread Petey
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

Django - how to create a private subpage?

2011-10-11 Thread Petey
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

Re: Model overriding predefined model methods.

2011-10-08 Thread Petey
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

Model overriding predefined model methods.

2011-10-08 Thread Petey
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

Image upload / embedding

2011-09-14 Thread Petey
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

Re: two views in one url

2011-09-11 Thread Petey
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

Re: Accessing related fields.

2011-09-11 Thread Petey
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

Re: Accessing related fields.

2011-09-11 Thread Petey
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

Re: Accessing related fields.

2011-09-11 Thread Petey
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

Re: Accessing related fields.

2011-09-11 Thread Petey
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

Accessing related fields.

2011-09-11 Thread Petey
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

Re: Accessing tuple element in templatetag, / Generating multi-level lists.

2011-09-10 Thread Petey
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

Accessing tuple element in templatetag, / Generating multi-level lists.

2011-09-10 Thread Petey
. 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

Binding two views to one url?

2011-09-08 Thread Petey
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

Django generic view - pagination

2011-09-03 Thread Petey
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

Odp: Django URL pattern - template tags

2011-09-02 Thread Petey
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

Django URL pattern - template tags

2011-09-02 Thread Petey
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

Django Admin - relationship between different models

2011-08-20 Thread Petey
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

Displaying form from app in other view.

2011-08-13 Thread Petey
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

Odp: Upload Multiple Images App ?

2011-08-06 Thread Petey
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

Views / Template - displaying data from other class.

2011-08-02 Thread Petey
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

Re: Django admin: naming subclass objects, fieldsets and displaying items from other class.

2011-07-17 Thread Petey
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

Django admin: naming subclass objects, fieldsets and displaying items from other class.

2011-07-17 Thread Petey
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

Re: Raise CommandError: One or more models did not validate

2011-07-14 Thread Petey
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

Re: Raise CommandError: One or more models did not validate

2011-07-14 Thread Petey
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

Re: Raise CommandError: One or more models did not validate

2011-07-14 Thread Petey
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

Re: Raise CommandError: One or more models did not validate

2011-07-14 Thread Petey
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

Re: Raise CommandError: One or more models did not validate

2011-07-14 Thread Petey
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

Raise CommandError: One or more models did not validate

2011-07-14 Thread Petey
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

Model "created_by"

2011-07-13 Thread Petey
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

User data shared between two websites

2007-06-20 Thread Petey
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. --~--~---