Re: Use custom HTML to render forms

2014-04-11 Thread Nikolas Stevenson-Molnar
I'm not clear from the example which of the code from base you want to keep, and which you want to be overriden. What should the resulting HTML look like? _Nik On 4/3/2014 2:52 AM, Fred DJar wrote: > actually i want the exact opposite > i want to KEEP my html with all the tags like and > >

Re: How to override admin field widget?

2014-04-11 Thread Mark Phillips
Athat makes sense. I was able to change the size of the text box in the widget file this way... forms.TextInput(attrs={'size':'5'}), Thanks again for all your help!! I learned a lot! Mark On Fri, Apr 11, 2014 at 9:03 AM, Lucas Klassmann wrote: > Hi Mark, >

Re: Django i18n questions

2014-04-11 Thread Andrew Pashkin
Indeed On 11.04.2014 12:45, Daniel Roseman wrote: On Friday, 11 April 2014 06:55:12 UTC+1, Andrew Pashkin wrote: Documentation says , that: ...it looks for a

Re: How to override admin field widget?

2014-04-11 Thread Lucas Klassmann
Hi Mark, You must understand that each Widget in : widgets = ( forms.TextInput(attrs=attrs), forms.TextInput(attrs=attrs), forms.TextInput(attrs=attrs), ) Has a *render()* method that return html of widget. You must only concatenate each html of

Re: How to override admin field widget?

2014-04-11 Thread Mark Phillips
Man, are you good;) It now works as expected! One last questionthe form shows three text boxes next to each other. How can I change the html to look like this: [ ] [ ] / [] {text_box} space {text_box} / {text_box} It has something to do with format_output, but I don't

Re: Relationships exposed over RESTful interface

2014-04-11 Thread Conrad Rowlands
It seems Defining the ManufacturerModelSerialiser thus has solved the problem (which backs up my last mail I think). Its not entirely what I wanted but it at least gets me down to just doing the 1 Query as I originally intended, 1 query is always better than 4000 odd! class

Re: How to override admin field widget?

2014-04-11 Thread Lucas Klassmann
Hi Mark, Because *TextInput *is a classe inside *forms *module and python is *case-sensitive*, try this: * forms.TextInput(attrs=attrs)* Cheers. On Fri, Apr 11, 2014 at 11:59 AM, Mark Phillips wrote: > Lucas, > > Thanks for your comment. > > I tried your

Re: Need idea how to keep data for multiple projects in one database

2014-04-11 Thread Gerald Klein
That is where is the magic of relational data comes into play like I said look into the normalization of relational data tables this will give you clues as to exactly how to link the tables as to be able to isolate your data correctly Gerald Klein DBA geraldklein.com contac...@geraldklein.com

Re: Relationships exposed over RESTful interface

2014-04-11 Thread Conrad Rowlands
OK . I take on board point 1 As for point two... I commented the ManufacturerViewset and the references to it in urls.py ,then when i run the url that I believe only looks at ManufacturerModelViewSet i get the following error: Could not resolve URL for hyperlinked relationship using view

Re: How to override admin field widget?

2014-04-11 Thread Mark Phillips
Lucas, Thanks for your comment. I tried your suggestion, and got this error 'module' object has no attribute 'textInput' referring to the forms.textInput(attrs=attrs) in the widget class. I am only trying to replace three out of 16 fields in my Inventory model with the custom widgets. I think

Re: How to override admin field widget?

2014-04-11 Thread Lucas Klassmann
Hi! I will test you code, but for now, try rewrite the form class, this way: class MeasurementForm(forms.ModelForm): width = forms.DecimalField(widget=MeasurementWidget()) height = forms.DecimalField(widget=MeasurementWidget()) length = forms.DecimalField(widget=MeasurementWidget())

Re: Need idea how to keep data for multiple projects in one database

2014-04-11 Thread DJ-Tom
The only thing that might be a problem is that participants from all kind of events are mixed in one huge table. When there is a need to do some kind of manual maintenance there is a bigger potential of changing data that belongs to a different event, compared to the old solution where each

Re: Apache, mod_wsgi and sharing videos to devices/machines

2014-04-11 Thread Adam Teale
Hmm seems that the error is just part of working with the development server. I shall work on trying to put this into production mode Cheers On Fri, Apr 11, 2014 at 10:31 AM, Adam Teale wrote: > Hi Guys, > > If someone has the time to take a look at this i'd really

Re: How to override admin field widget?

2014-04-11 Thread Mark Phillips
I looked at the MultiWidget and tried to implement following a couple of examples, but I have run into a problem. I get this error when I try to open the admin form - type object 'MeasurementWidget' has no attribute 'attrs' widgets.py class MeasurementWidget(forms.MultiWidget): def

Re: Relationships exposed over RESTful interface

2014-04-11 Thread Javier Guerra Giraldez
On Fri, Apr 11, 2014 at 8:31 AM, Conrad Rowlands wrote: > As you can see the queryset is loading all from the database What I > would prefer to be able to do is to share the first queryset from the > ManufacturerModelViewSet (which should have all of the

Re: Need idea how to keep data for multiple projects in one database

2014-04-11 Thread Gerald Klein
it sounds like you are on the right track, only thing is that you may want to take a look at data normalization in relational databases, this will give you some clues as to how best link the tables that you are describing On Fri, Apr 11, 2014 at 8:50 AM, DJ-Tom wrote: >

Need idea how to keep data for multiple projects in one database

2014-04-11 Thread DJ-Tom
Hi, I'm currently planning to port an old application that was used to register participants for events to Django. The old app did not have any real database system, but was based on dBase files. There was one global table where the basic information about each event was stored (like event

Re: Relationships exposed over RESTful interface

2014-04-11 Thread Conrad Rowlands
Hi Javier, Sorry for not being a bit clearer. Basically I am making a URL call to return all of the models with a given manufacturer. So the first SQL statement generated is returning all of the ManufacturerModel AND (because of the select related) all of the Manufacturers too in one query.

Apache, mod_wsgi and sharing videos to devices/machines

2014-04-11 Thread Adam Teale
Hi Guys, If someone has the time to take a look at this i'd really appreciate it. I am in the process of developing a small django app to manage some aspects of our production company - users, projects etc... I am in a moment where I would like to get some people on the local network to start

Re: Remind the users when their accounts are expiring

2014-04-11 Thread Javier Guerra Giraldez
On Fri, Apr 11, 2014 at 6:39 AM, pije76 wrote: > How to remind the users via email when their accounts are expiring based on > the time schedule (such as: 2 weeks away from deactivation & the day before > the deactivation itself). I wouldn't bother with searching for an

Re: Relationships exposed over RESTful interface

2014-04-11 Thread Javier Guerra Giraldez
On Fri, Apr 11, 2014 at 3:51 AM, Conrad Rowlands wrote: > I would still be keen to know if there is any know method that would allow > me to load this data using only the 1 queries bringing in all of the related > fields in the original query. what's the first

Re: QuerySet doubt

2014-04-11 Thread Rafael E. Ferrero
I think, for what i see on his docs, that https://github.com/chrisglass/django_polymorphic can help in my task. Saludos Cordiales, -- Rafael E. Ferrero 2014-04-11 2:35 GMT-03:00 Rafael E. Ferrero : > Found a bug in that view (see revision 3 of linkode) but my

True Model Inheritance

2014-04-11 Thread Thomas Güttler
I know that there are several model inheritance extensions available: https://www.djangopackages.com/grids/g/model-inheritance/ But it is hard for me to decide which one to take. The most common solutions seem to be: django-model-utils django-polymorphic My use case is simple: This

Re: Use custom HTML to render forms

2014-04-11 Thread Lucas Klassmann
Hi, Let me see if i understand, you want put and per field? Because if you want customize per field, you can iterate in fields of form like this: *{% for field in form %}* *{{ field.label }}* * {{ field }}* *{% endfor %}*

Remind the users when their accounts are expiring

2014-04-11 Thread pije76
How to remind the users via email when their accounts are expiring based on the time schedule (such as: 2 weeks away from deactivation & the day before the deactivation itself). Are there recommended app/package to use? Thanks for helping. -- You received this message because you are

Re: Use custom HTML to render forms

2014-04-11 Thread Fred DJar
Thanks for the response.But in my case i use customized html tags like and : so how to deal with html tags like and and add them to the email param On Friday, 11 April 2014 12:08:19 UTC+1, Lucas Klassmann wrote: > >

Re: Use custom HTML to render forms

2014-04-11 Thread Lucas Klassmann
Hi Fred. You must put {% block %} {% endblock %} in html where you want allow override in others base.html descendants. Like this: # base.html {% block title %}{% endblock %} {% block fields %}{% endblock %} # other.html {% extends "base.html" %} {% block

Re: Use custom HTML to render forms

2014-04-11 Thread Fred DJar
ANY IDEA GUYS? On Thursday, 27 March 2014 13:48:47 UTC, Fred DJar wrote: > > Hello, > I am a beginner in python and django programming, i have a question that > already have been asked in stackoverflow and many forums, but i couldnt > solve my own. > > this exactly my situation: > > this the

Re: How to filter queryset object list with matching parameter?

2014-04-11 Thread Lucas Klassmann
Hi, Sorry, you must specify the field *ID*, try this: for user in user_object_list: if user.is_locked(): user_exclude_list.append(user.id) user_list = user_list.exclude(*id__in*=user_exclude_list) # [1, 3, 4, 5,] IDs, is more fast Cheers. On Fri, Apr 11, 2014 at 7:47 AM,

Re: How to filter queryset object list with matching parameter?

2014-04-11 Thread nobody
Hi Lucas, On Friday, April 11, 2014 12:07:02 PM UTC+10, Lucas Klassmann wrote: > > Hi, > > You can use *ID* of object for compare with a list and *IN* : > > for user in user_object_list: > if user.is_locked(): > user_exclude_list.append(user.*id*) > > user_list =

Re: Relationships exposed over RESTful interface

2014-04-11 Thread Conrad Rowlands
Hi Javier, Thank you for your quick response. Sadly I could not get your solution to work however you helped to point me in the right direction to a workable though not entirely satisfactorey solution. What I did was to refactor my ViewSet Class thus:- class

Re: Django i18n questions

2014-04-11 Thread Daniel Roseman
On Friday, 11 April 2014 06:55:12 UTC+1, Andrew Pashkin wrote: > > Documentation > says, > > that: > > ...it looks for a django_language key in the current user’s session > > This is the

Re: Django i18n questions

2014-04-11 Thread Andrew Pashkin
I ended up using this snippet for switching languages. It simply reverses url with given language code. On 11.04.2014 09:55, Andrew Pashkin wrote: Documentation says