Hi,
I have two different django projects which each project having different
model
Lets say projects to be p1 and p2
Now i have to populate the data from p1 model to a model in p2 ( note p1
and p2 models are different, i just have to use some data from p1 model to
move to p2)
Now in order to
if you check the error message
DETAIL: Failing row contains (3, 1, Consultation OPD, 135, 135, null, 1).
There are total of 7 values
Check your model
class CGHSRates(models.Model):
rid = models.AutoField(primary_key=True)
serial = models.IntegerField(default=0)
name = models.CharField(max_lengt
In the First Screenshot the code is
def __str__(self):
return "Customer" + "self.id"
Remove the quotes from "self.id"
def __str__(self):
return "Customer" + self.id
On Wed, 12 Dec 2018 at 10:47, wrote:
>
> TY madjardi for all your input! I continued to search and found what I
> wanted. But
Hi,
If the Data Base is already present then Django provides an handy command
which will translate your Database schemas into Django models
You have to run python manage.py inspectdb
It will auto generate the models based on the Schema.
Best way to access the data present in the db in the Djang
*def add_comment(request, slug):*
*post = get_object_or_404(Post, slug=slug)*
*if request.method == 'POST':*
*form = CommentForm(request.POST)*
*if form.is_valid():*
*comment = form.save(commit=False)*
*comment.post = post*
*comment.save()
try renaming path('post//comment/', views.add_comment, name=
'add-comment'),
to path('post//comment/', views.add_comment, name='add-comment'),
On Fri, 12 Oct 2018 at 12:36, Robert CR wrote:
> i fixed the error, thanks. But there is already a new one when i try to
> add a comment. D:
>
> [image:
Hi,
Try after name-spacing url patterns i.e
app_name = 'blog'
urlpatterns = [
path('', PostListView.as_view(), name='blog-home'),
path('user//', UserProfileListView.as_view(), name=
'user-profile' ),
path('user//posts/', UserPostListView.as_view(), name=
'user-posts'),
path('user
Hi,
I am working on a project where i am using a single django app which is
backed by different databases.
Let me explain the use case clearly,
I have a app say app1, and app1 data is located in two different databases
say db1 and db2
data present in the db1 and db2 are different, lets say db1 h
url(r'^$', 'blog.views.home', name='home')
You are passing a string as view by quoting blog.views.home
remove the quotes and try, i.e url(r'^$', blog.views.home, name='home')
On Fri, 24 Aug 2018 at 03:17, herve kabore wrote:
> this is the urls.py
>
>
> from django.conf.urls import url
> fro
1.open your django project
2.open the terminal in pycharm, it is located at bottom left corner
3. in the terminal change the directory to the location where manage.py is
located
4. type the following python3.7 manage.py shell
On Thu, 16 Aug 2018 at 10:20, Vikrant Gupta
wrote:
> I did according
have you tried
form.save(commit = True) ?
On 18 July 2018 at 01:27, wrote:
> Is there a paid support option to get help? I've been trying to ask for
> help on IRC for a while but all I've gotten is insults.
>
> On Monday, July 16, 2018 at 6:06:00 PM UTC-4, cbpa...@gmail.com wrote:
>>
>> I'm u
I would suggest you to try this code
sav_list = List(id=4, item_name ='name1', item_desc='desc1',
location='location', reason='rfp', pid=Order.objects.get(poid = 3))
Instead of passing integer 3 to pid, try to the pass the order Object
which has the poid = 3
On 17 July 2018 at 17:33, Sainath B
I think there is a ' , ' missing after 'DIRS' in Templates settings
On Saturday, 30 June 2018, Umar Kambala wrote:
>
> this are my codes...
>
> # SECURITY WARNING: don't run with debug turned on in production!
> DEBUG = True
>
> ALLOWED_HOSTS = ['127.0.0.1', '.pythonanywhere.com']
> ALLOWED_HOST
13 matches
Mail list logo