Re: how to learn django and I don't kill in the attempt,

2014-12-15 Thread Russell Keith-Magee
On Mon, Dec 15, 2014 at 2:57 PM, Shazwi Suwandi wrote: > +1 to what Jorge mentioned. You can find books online but most of them > (the ones I found) cover up till Django 1.6 and if you wanna use Django > 1.7, some things won't apply. For example, things like South is already > integrated into Dja

Re: Django don't load css

2014-12-15 Thread Jovana Andjelkovic
It is not 404,it is 304 NOT MODIFIED,and it load it as text/plain... On Monday, December 15, 2014 8:23:22 AM UTC+1, somecallitblues wrote: > > You may have an error in your css file if the link isn't 404ring when you > look at your console or the chrome tab... > On 15/12/2014 1:36 pm, "Jovana An

Re: Odd subform caching problem

2014-12-15 Thread Daniel Roseman
On Monday, 15 December 2014 00:53:05 UTC, Gerald Klein wrote: > > HI, I have a simple contact form with an address subform in the form of > "TabularInline" where you can add an arbitrary amount of addresses, after I > add a contact and an address and save, when I go to add a brand new contact >

Re: Models not appearing in db. Am I missing something?

2014-12-15 Thread David Palao
Hello, >From your post I understand you did not write unittests for your models? I would recommend to write some sensible tests for them and start tracing your problem from the failures you should get. Best, David 2014-12-15 8:15 GMT+01:00 Shazwi Suwandi : > I've added 'core' to settings.py file

Re: Odd subform caching problem

2014-12-15 Thread Gerald Klein
Daniel, I didn't include any code as I didn't do anything unusual but if you think that would help here it is.I was hoping that there was some ordinary theoretical basis for this as I didn't do anything custom really, aside from the id generation for the "Entity" class, which I generate the id manu

Re: Help Requried : FieldError at /admin/movie/movie/add/

2014-12-15 Thread Muhammad Ahmed
> > Somehow I have managed the problem. > Thanks to those who took their time to read this post. -- 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-user

Re: Models not appearing in db. Am I missing something?

2014-12-15 Thread Shazwi Suwandi
Hey David, You're right, I have to practise writing tests along with my codes. However, just to clarify, data input and output works. I can call the data in the Member object. I'm just confused as to why the Member table does not show up in my postgres database. It's weird. Nevertheless, I'll

Re: Odd subform caching problem

2014-12-15 Thread Daniel Roseman
On Monday, 15 December 2014 11:04:13 UTC, Gerald Klein wrote: > > > > Daniel, > I didn't include any code as I didn't do anything unusual but if you think > that would help here it is.I was hoping that there was some ordinary > theoretical basis for this as I didn't do anything custom really, as

Re: Odd subform caching problem

2014-12-15 Thread Gerald Klein
if I remove the parens, when I submit to create the new entity is throws a validation error that does not specify the field that is wrong, "Please correct the error below." --jerry On Mon, Dec 15, 2014 at 6:20 AM, Daniel Roseman wrote: > > On Monday, 15 December 2014 11:04:13 UTC, Gerald Klein w

Re: Need to search through several tables using one model

2014-12-15 Thread Damjan Dimitrioski
I wrapped something like this: https://dpaste.de/4WTq However, I'm not able to see any results in the changelist view, but the get_query_set method prints the query results in the STDOUT, what I'm doing wrong ? On Sat, Dec 13, 2014 at 11:27 PM, Damjan Dimitrioski < damjandimitrio...@gmail.com> wr

Re: Need to search through several tables using one model

2014-12-15 Thread Vijay Khemlani
The dpaste link is broken On Mon, Dec 15, 2014 at 9:48 AM, Damjan Dimitrioski < damjandimitrio...@gmail.com> wrote: > > I wrapped something like this: > https://dpaste.de/4WTq > > However, I'm not able to see any results in the changelist view, but the > get_query_set method prints the query resul

Re: Need to search through several tables using one model

2014-12-15 Thread Damjan Dimitrioski
Oh, sorry about that, it was se to an hour, here is an updated one: https://dpaste.de/q9sq On Mon, Dec 15, 2014 at 2:13 PM, Vijay Khemlani wrote: > > The dpaste link is broken > > On Mon, Dec 15, 2014 at 9:48 AM, Damjan Dimitrioski < > damjandimitrio...@gmail.com> wrote: > >> I wrapped something

Thinking about EAV database model for flexibility. How (in)compatible is it with the django model?

2014-12-15 Thread Felipe Faraggi
Hello everybody. I am very new to django and I come from a wordpress background (yes, yes I know) and I really like their wp_*meta model. After a little digging I discovered this is called the Entity-attribute-value model or EAV

how to connect parse.com with parse-rest

2014-12-15 Thread Carlos Ons
I cannot connect to parse.com with parse-rest API. I have a virtualenv installed and when I try to connect to parse.com It is impossible. I made a basic app and the error is: ImportError at / No module named parse_rest.connection Request Method:GETRequest URL:http://127.0.0.1:8000/Django Vers

Re: how to connect parse.com with parse-rest

2014-12-15 Thread Vijay Khemlani
Are you running the dev server while having the viartualenv activated? On Mon, Dec 15, 2014 at 11:19 AM, Carlos Ons wrote: > > I cannot connect to parse.com with parse-rest API. > > I have a virtualenv installed and when I try to connect to parse.com It > is impossible. I made a basic app and the

Re: how to learn django and I don't kill in the attempt,

2014-12-15 Thread Shazwi Suwandi
My bad! Apologies.. Thanks for the clarification :) On Monday, 15 December 2014 17:06:44 UTC+8, Russell Keith-Magee wrote: > > > > On Mon, Dec 15, 2014 at 2:57 PM, Shazwi Suwandi > wrote: > >> +1 to what Jorge mentioned. You can find books online but most of them >> (the ones I found) cover up

Re: how to learn django and I don't kill in the attempt,

2014-12-15 Thread Mark Phillips
After you go through the django tutorial (really the best place to start), check out Two Scoops of Django (book). I think it is only up to version 1.6, so some things may have changed or look a little different. Mark On Mon, Dec 15, 2014 at 8:44 AM, Shazwi Suwandi wrote: > > My bad! Apologies..

Re: Thinking about EAV database model for flexibility. How (in)compatible is it with the django model?

2014-12-15 Thread Erik Cederstrand
> Den 15/12/2014 kl. 14.42 skrev Felipe Faraggi : > > After a little digging I discovered this is called the Entity-attribute-value > model or EAV. And I am currently setting up a project in django in which my > data is very variable because we will be opening up to many APIs and they all > ha

Customize admin site labels

2014-12-15 Thread Xairi Valdivia Maker
Hi all. I was trying to customize the Django admin site today. I'm strating trying to change the labels Django admin in the login and in the admin site for something else, but i can't. I found this: https://docs.djangoproject.com/en/1.7/ref/contrib/admin/#adminsite-attributes But i don't know

Re: Postgres function json_array_elements does not found while django's tests

2014-12-15 Thread Volodymyr B
*Solved* Mistake in query json_array_elements(animated_groups) Needs change to this: json_array_elements(animated_groups::json) On Friday, 14 November 2014 17:14:18 UTC, Volodymyr B wrote: > > Hi all > > > I have class method in django model which is use json_array_elements > function. > > In c

How can I add an attribute to each option in a django model form containing a foreign key?

2014-12-15 Thread Jonathan Dan
Hello, I have two models: class Currency(models.Model): ... available = models.BooleanField() class Offer(models.Model): ... currency = models.ForeignKey('Currency') I make a form from the Offer model: class OfferForm(ModelForm): class Me

Re: django template auto format tool?

2014-12-15 Thread Abraham Varricatt
@José Luis Regalado, The vim idea is interesting, but I don't think too many developers can be convinced to open a file in a different editor just to format it. @ somecallitblues , Same reasoning. I'm using Pycharm myself, but for a mixed-editor/IDE team, I need a different tool to standardiz

HOW TO Configure url and view for filter between two dates

2014-12-15 Thread Efe
Hello, don't know to how configure views.py and urls.py in myapp. for filter a list between dates from an input date in a template. This is my models.py: class Paciente(models.Model): tipo_doc = models.ForeignKey(Tipo_doc) num_doc = models.CharField(max_length=20, primary_key=True) ...

AttributeError raised when calling form's superclass clean() method, however the form doesn't get filled with errors

2014-12-15 Thread Héctor Urbina
Hello, I have the following Form: class TargetAllocationsForm(forms.Form): def __init__(self, cliente, *args, **kwargs): super(TargetAllocationsForm, self).__init__(*args, **kwargs) for cat in CategoriaActivo.objects.all(): self.fields[cat] = forms.FloatField(label=cat.nombre, min

Re: Django don't load css

2014-12-15 Thread Jovana Andjelkovic
This is my html head with css link: Rango This is settings.py: import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) TEMPLATE_PATH = os.path.join(BASE_DIR, 'templates') STATIC_PATH = os.path.join(BASE_DIR, 'static') MEDIA_ROOT = os.path.join(BASE_DIR, 'media') STATIC_ROOT = os.path.joi

Re: HOW TO Configure url and view for filter between two dates

2014-12-15 Thread Héctor Urbina
Hello, In urls.py you define the url that serves the page you're building, something like this would work: from django.conf.urls import patterns, url from import views urlpatterns = patterns('.views', url(r'^$',views.index, name="index"), url(r'^listarConsultas/$', views.listarConsult

Re: HOW TO Configure url and view for filter between two dates

2014-12-15 Thread Efe
Hi Hector, thanks for replying. Because I'm starting with Django I don´t know how to do a class ModelForm with parameters. Can you help me? Thank you very much (sorry for my poor english) El lunes, 15 de diciembre de 2014 14:36:08 UTC-3, Efe escribió: > > Hello, don't know to how configure view

AttributeError raised when calling form's superclass clean() method, however the form doesn't get filled with errors

2014-12-15 Thread Daniel Roseman
You should show your view. You should not call clean directly: it is called automatically by is_valid. Also note that the keys of self.fields are strings, so neither your if nor your elif will ever execute. -- DR. -- You received this message because you are subscribed to the Google Groups "

Re: HOW TO Configure url and view for filter between two dates

2014-12-15 Thread Héctor Urbina
I'm sorry, I missleaded you, what you really want to use is a ModelChoiceField in a custom form. So you can create a form with the following code: from django import forms class pacienteConsultasForm(forms.Form): fecha

Re: AttributeError raised when calling form's superclass clean() method, however the form doesn't get filled with errors

2014-12-15 Thread Héctor Urbina
This is my view: def perfilInversionCliente(request, cliente_pk): objetos = {} cliente = get_object_or_404(Cliente, pk=cliente_pk) targetAllocationsForm = TargetAllocationsForm(cliente=cliente) if request.method == "POST": targetAllocationsForm = TargetAllocationsForm(request.POST)

Re: How can I add an attribute to each option in a django model form containing a foreign key?

2014-12-15 Thread Vijay Khemlani
If the crispy form is using the usual render methods of Django you can subclass the Select class (in forms/widgets.py), reimplement the "render_option" method and add the parameter to the returned HTML, then you can set the widget attribute of the form field to your created class. I don't know whe

Re: HOW TO Configure url and view for filter between two dates

2014-12-15 Thread Efe
Excelent!! I´ll try it and I´ll tell you the results. Thanks in advance (sorry for my poor english) El lunes, 15 de diciembre de 2014 14:36:08 UTC-3, Efe escribió: > > Hello, don't know to how configure views.py and urls.py in myapp. for > filter a list between dates from an input date in a tem

Re: Django don't load css

2014-12-15 Thread Héctor Urbina
somecallitblues didn't say that it's 404 error, he said that you could have an error (some typo) in your base.css... perhaps you should check it with some css validator. On Monday, December 15, 2014 6:44:11 AM UTC-3, Jovana Andjelkovic wrote: > > It is not 404,it is 304 NOT MODIFIED,and it load

Re: Caching for django.contrib.sites

2014-12-15 Thread Tom McKenzie
Thanks Colin, I'll give that a try. On Sunday, December 14, 2014 11:25:57 AM UTC-8, Collin Anderson wrote: > > Hi Tom, > > It should work to set up your own sites model with the same table name, as > long as you can change all foreign keys to point to _your_ site model. > > Are you actually using

CBV with inline formset

2014-12-15 Thread Brad Rice
I've pretty much butchered the code for 3 days now and cannot figure out how to insert an inline formset. Can anybody help me? I've tried to pare everything down to use two simple Models just to try to get an insert. I'm using django Author - Book relationship to keep it simple. class Author(m

InMemoryUploadedFile object retrieved from request.FILES got closed automatically on django 1.7

2014-12-15 Thread Hong Yi
Hello, I am new to Django and have implemented two views and their corresponding template pages and they are working well in Django 1.6. However, when migrating to Django 1.7, I got an error "I/O operation on closed file" when getting to the second view function. I found out the root cause for

Re: CBV with inline formset

2014-12-15 Thread Vijay Khemlani
Try changing the name of the parameter in the url from author_id to pk On Mon, Dec 15, 2014 at 5:39 PM, Brad Rice wrote: > > I've pretty much butchered the code for 3 days now and cannot figure out > how to insert an inline formset. Can anybody help me? > > I've tried to pare everything down to u

Re: CBV with inline formset

2014-12-15 Thread Dan Gentry
I created a couple of mixins for a project that might help you. See this gist: https://gist.github.com/dashdrum/03858d79ddfd9bba44d6 Pretty easy to use. Here's an example Create view: class RegistrationView(FormsetCreateMixin,CreateView): template_name = 'registration/registration_form.htm

Re: Django don't load css

2014-12-15 Thread Jovana Andjelkovic
Sorry,I didn't understand him :) I check css with css validator and it didn't find any errors.It is simple css file,just to check if everithing is working. I don't understand why css is not recognised as text/css,but as text/plain. Thank you for your answer... -- You received this message becau

Re: CBV with inline formset

2014-12-15 Thread Brad Rice
Thanks. I think I figured out how to do this with a straight createView. class BookCreate(CreateView): model = Book form_class = BookForm template_name = 'book_template.html' success_url = u'/dp/thanks' def get(self, request, *args, **kwargs): self.object = None form_class = self.get_form_class()

Re: Python/Django programmers needed (telecommute)...

2014-12-15 Thread Jason McVetta
My qualifications are a great match for this role. I'm available FT on-site for $300/hr. Rate is negotiable for remote or less than full-time work. -- sent from my robot On Dec 4, 2014 3:55 PM, "Fred Stluka" wrote: > Django programmers, > > Interested in a telecommute position for $80-100K/

Re: InMemoryUploadedFile object retrieved from request.FILES got closed automatically on django 1.7

2014-12-15 Thread Russell Keith-Magee
On Tue, Dec 16, 2014 at 4:53 AM, Hong Yi wrote: > Hello, > > I am new to Django and have implemented two views and their corresponding > template pages and they are working well in Django 1.6. However, when > migrating to Django 1.7, I got an error "I/O operation on closed file" when > getting to

Re: Thinking about EAV database model for flexibility. How (in)compatible is it with the django model?

2014-12-15 Thread Jamie Lawrence
Just to add to Erik's very good advice on (not) using EAV, another thing to keep in mind is that the downsides of EAV tend to manifest after your app is hosting a substantial amount of data, at which point the exercise of sanitizing it in order to port it to a saner model can be *excruciating*.

Re: Django-compressor manifest.json problem on Heroku

2014-12-15 Thread Collin Anderson
Hi Guy, I haven't used django_compressor, but it might help to configure COMPRESS_OFFLINE_MANIFEST. Collin On Saturday, December 13, 2014 11:54:27 AM UTC-5, Guy Tamir wrote: > > I haven't configured django caching, how do I do that? > > Also - CachedS3BotoStorage is this: > > from django.core.f

Re: python manage.py runserver ImportError

2014-12-15 Thread Collin Anderson
Hi, What version of django and python are you using? Is your project set up like this? myapp/ myapp/manage.py myapp/myapp/__init__.py myapp/myapp/settings.py myapp/myapp/urls.py myapp/myapp/wsgi.py? Collin On Sunday, December 14, 2014 4:24:12 AM UTC-5, Saki Fu wrote: > > I run python manage.py

Re: Models not appearing in db. Am I missing something?

2014-12-15 Thread Mario Gudelj
What's the output of your makemigrations command? If those models are inside core/models.py and your app is inside installed apps in settings this should totally work. The default name for the table will be appname_modelname. Do you get an error when accessing the model? How are you checking the db

Re: Can anyone give me a suggestion or a recommendation as to how I can access the current user's username in the models.py?

2014-12-15 Thread Collin Anderson
Hi Fred, I don't see how it could possibly be thread-safe without using a thread-local. But, if you don't deploy using threads then you should be fine. I agree with Russ that explicit is better than implicit. I think there is some benefit to simply being able to ask for the the current reques

Re: Swampdragon, the realtime framework for Django seems interesting. But will it scale ?

2014-12-15 Thread Aaron Reabow
the thing i am trying to figure out is how this works with my existing setup. I get that you need to install redis. but how does the rest of the stack change mine is through the good people at webfaction: apache tomcat nginx (static) postgres python2.7 django1,6 html/css/js how much of this c

Re: Models not appearing in db. Am I missing something?

2014-12-15 Thread Shazwi Suwandi
Hey Mario, The output I get when I use makemigrations is 0001_initial.py: - Create model Member. I've double checked: - The 'Member' model is in core/models.py - 'Core' is inside project/settings.py I use python manage.py shell and I accessed the 'User' object and the linked

Re: Models not appearing in db. Am I missing something?

2014-12-15 Thread Shazwi Suwandi
Hey guys, I figured it was a problem with the app I'm using for the db. I went to use another app and now the tables are showing. Silly me. Thanks Mario and David for your helpful advice. :) On Tuesday, 16 December 2014 13:33:36 UTC+8, Shazwi Suwandi wrote: > > Hey Mario, > > The output I get